disabling warn_unused_result attribute with FORTIFY_SOURCE?

Ulrich Drepper drepper at redhat.com
Thu Mar 15 03:11:52 UTC 2007


Matthew Miller wrote:
> My google-fu is failing me; I can't find any documentation on this.
> Apparently, building with -Wp,-D_FORTIFY_SOURCE=2 results in the
> warn_unused_result attribute being added to every (? or maybe just many)

Only cases without valid cases where ignoring the value might be correct.

> fuction. In turn, this makes many perfectly good programs spit out hundreds
> of warnings. I'm not sure this is necessarily good.

Fix the code.  All those warnings are problems.


> Unlike other warnings, though, there doesn't seem to be a way to turn it
> off. Is there one I'm missing?

There is no way.


> I'd like to clean up all the real errors and turn on -Werror....

Then you have to fix all those warnings, too.  Programs which fail to
test return values are unreliable at best.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20070314/1cd68876/attachment.sig>


More information about the fedora-devel-list mailing list