This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warn_unused_result attribute ignoring
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Timo Sirainen <tss at iki dot fi>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 12 Nov 2006 13:08:29 -0800
- Subject: Re: warn_unused_result attribute ignoring
- References: <1163365382.8783.150.camel@hurina>
On Sun, 2006-11-12 at 23:03 +0200, Timo Sirainen wrote:
> If I understood correctly, newer glibcs have added warn_unused_result
> attribute to several functions when compiling with -D_FORTIFY_SOURCE=2.
warn_unused_result means warn if the result is unused even with (void).
This warning is doing what it is designed to do. -D_FORTIFY_SOURCE=2
means warn when you are ignoring return values and other stuff. If
chdir fails you should handle that case and not just ignore it like you
are doing.
Thanks,
Andrew Pinski