Repository navigation
Conversation
vszakats
marked this pull request as draft
June 15, 2026 19:29
Follow-up to c8d8f08 curl#22023 Follow-up to e95f509 curl#16852
There was a problem hiding this comment.
Pull request overview
This PR addresses build failures in tests/server/util.c caused by -Werror=unused-result when write() is declared with __attribute__((warn_unused_result)) (e.g., in some glibc configurations). It adds a targeted compiler diagnostic suppression so the signal handler can intentionally ignore write() return values without failing builds.
Changes:
- Add GCC diagnostic
push/ignored/poppragmas to silence-Wunused-resultaroundexit_signal_handler(). - Replace intermediate
rcbookkeeping (and theuselesssink) with explicit(void)write(...)calls.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In some configurations the
write()functions gets thewarn_unused_resultattribute, 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.
Ref: https://github.com/curl/curl/actions/runs/27548333990/job/81427544632
Refs:
#22023 (comment)
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 c8d8f08 #22023
Follow-up to e95f509 #16852