curl/tests/server
Viktor Szakats 526d3b8a53
servers: silence -Wunused-result with pragma
In some configurations the `write()` functions gets the
`warn_unused_result` attribute, that makes casting to `(void)`
ineffective to silence this warning. Seen with glibc, in 5 CI jobs.
The warning option appeared in GCC 4.5 and comes enabled by default.

```
tests/server/util.c:329:5: error: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  329 |     write(STDERR_FILENO, msg, sizeof(msg) - 1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/27548333990/job/81427544632

Refs:
https://github.com/curl/curl/pull/22023#issuecomment-4708455631
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Warning-Options.html#index-Wunused-result
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Common-Attributes.html#index-warn_005funused_005fresult
https://stackoverflow.com/questions/40576003/ignoring-warning-wunused-result

Follow-up to c8d8f081fd #22023
Follow-up to e95f509c66 #16852

Closes #22034
2026-06-15 22:04:39 +02:00
..
.checksrc build: tidy up and dedupe strdup functions 2026-02-03 14:02:30 +01:00
.gitignore tests: always make bundles, adapt build and tests 2025-06-14 21:08:23 +02:00
CMakeLists.txt cmake: rename testbins target to tt, restore internal option 2026-03-01 00:24:47 +01:00
dnsd.c servers: minor socket error handling fixes 2026-06-14 16:16:25 +02:00
first.c tidy-up: drop stray comparisons with literal zero 2026-06-10 15:15:54 +02:00
first.h build: include curlx headers directly in src and tests 2026-03-16 12:05:39 +01:00
getpart.c tidy-up: miscellaneous 2026-06-14 20:10:28 +02:00
Makefile.am autotools: limit checksrc target to ignore non-repo test sources 2026-03-12 01:45:24 +01:00
Makefile.inc tests/server: drop unused curlx/version_win32.c 2026-03-08 18:17:11 +01:00
mqttd.c servers: drop single-use interim result variables 2026-06-14 17:49:33 +02:00
resolve.c build: use more const 2026-02-02 12:32:49 +01:00
rtspd.c tidy-up: miscellaneous 2026-06-14 20:10:28 +02:00
sockfilt.c tidy-up: miscellaneous 2026-06-14 20:10:28 +02:00
socksd.c servers: drop single-use interim result variables 2026-06-14 17:49:33 +02:00
sws.c tidy-up: miscellaneous 2026-06-14 20:10:28 +02:00
tftpd.c tidy-up: miscellaneous 2026-06-14 20:10:28 +02:00
util.c servers: silence -Wunused-result with pragma 2026-06-15 22:04:39 +02:00