This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))
- From: "kilobyte at angband dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Aug 2017 10:02:30 +0000
- Subject: [Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))
- Auto-submitted: auto-generated
- References: <bug-66425-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
Adam Borowski <kilobyte at angband dot pl> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kilobyte at angband dot pl
--- Comment #28 from Adam Borowski <kilobyte at angband dot pl> ---
Please tell me: what would be other likely uses for such an explicit (void)
cast _other_ than trying to silence this warning? I can't think of any.
Thus, I'd recommend to keep it simple and instead of adding complex
really_strict_unavoidable_warn_unused_result options, just make (void) shut it
down. It did the thing for many years before.
There's too many system headers which abuse this attribute. On one hand you
have realloc(), on the other write(STDERR, "error message").