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

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jun 14 17:29:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |segher at gcc dot gnu.org

--- Comment #18 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Another way of ignoring the unused result, friendlier on the eyes than
ugly macros or horrible casts, and even *inviting* the programmer to
write an explanatory comment, goes like

if (foo()) {
  /* The return value of foo can be ignored here because X and Y.  */
}



More information about the Gcc-bugs mailing list