This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))


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").

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]