mirror of
https://github.com/curl/curl.git
synced 2026-06-18 17:55:38 +03:00
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
|
||
|---|---|---|
| .. | ||
| .checksrc | ||
| .gitignore | ||
| CMakeLists.txt | ||
| dnsd.c | ||
| first.c | ||
| first.h | ||
| getpart.c | ||
| Makefile.am | ||
| Makefile.inc | ||
| mqttd.c | ||
| resolve.c | ||
| rtspd.c | ||
| sockfilt.c | ||
| socksd.c | ||
| sws.c | ||
| tftpd.c | ||
| util.c | ||