Attribute warn_unused_result

Robert Connolly robert at
Thu Aug 24 21:38:56 PDT 2006

Fedora is building everything with -D_FORTIFY_SOURCE=2. I hoped they fixed the 
warnings in some packages, but at least with Binutils they have not. But they 
also do not add -D_FORTIFY_SOURCE=2 to gcc specs, they patch Makefile's one 
by one or use CFLAGS.

This url explains this warning a bit:

"The warn_unused_result attribute causes a warning to be emitted if a caller 
of the function with this attribute does not use its return value. This is 
useful for functions where not checking the result is either a security 
problem or always a bug, such as realloc."


On Thursday 24 August 2006 00:03, Robert Connolly wrote:
> Those warnings are from -D_FORTIFY_SOURCE=2, and I didn't realize it
> produced warnings. I removed -Werror for now until it can be fixed. I don't
> remember having a problem with butterfly toolchain with
> --enable-werror-always though.
> robert
> On Wednesday 23 August 2006 15:33, Filip Bartmann wrote:
> > How can I disable(adjust source code)warnings about functions "declared
> > with attribute warn_unused_result" in many HLFS packages, which is
> > treated as errors with -Werror switch, which is in HLFS book used.
> > This is with functions as:fgets,mktemp,fwrite_unlocked,fscanf,chdir...
> > in packages as butterfly-toolchain,findutils,make...
> > Filip Bartmann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the hlfs-dev mailing list