Request for suppressing "warn_unused_result" warnings

Dave Korn dave.korn.cygwin@gmail.com
Sat May 29 00:14:00 GMT 2010


On 28/05/2010 19:32, Ian Lance Taylor wrote:

> As the compiler documentation states, warn_unused_result was intended
> for cases where failing to check the return value is always a security
                                                       ^^^^^^
    Note: "always".

> risk or a bug. 

  OK, that's reasonable as far as it goes, but there is *no* circumstances
under which ignoring the return from *any* function is *always* a bug.  So we
should provide a user override mechanism.

  I read the whole PR22509 audit trail, and it seems to me the reasoning is
based on a false assumption that there is only one set of consumers of GCC,
and that is "everybody".  I'm willing to believe that there are two classes of
users, those who build OSes and system libcs, and those who just want to write
end-user code; and that their interests might sometimes be in conflict, and
therefore the compiler shouldn't enforce the standards of either one of our
subset of users against the others.

    cheers,
      DaveK




More information about the Gcc mailing list