Re: warn_unused_result seems to generate spurious warnings

2008-12-04 Thread Andrew Haley
Andrew Haley wrote: > In this test case: I now see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 Please ignore my earlier message.

warn_unused_result seems to generate spurious warnings

2008-12-04 Thread Andrew Haley
In this test case: int fn () __attribute__ ((warn_unused_result)); int foo () { if (fn () < 0) return -1; (void) fn (); return 0; } $ gcc -S -Wall ~/p.c /home/aph/p.c: In function 'foo': /home/aph/p.c:5: warning: ignoring return value of 'fn', declared with attribute warn_unused_resul