This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: warn_unused_result attribute ignoring


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]