[patch] ld: optimize vfinfo output slightly

Mike Frysinger vapier@gentoo.org
Sat Mar 31 02:48:00 GMT 2012


On Friday 30 March 2012 20:30:48 Alan Modra wrote:
> On Fri, Mar 30, 2012 at 01:20:24PM -0400, Mike Frysinger wrote:
> > the reason i didn't do that is it causes warnings since fwrite() is
> > marked as "warn on unused result"
> 
> (void) fwrite (...);

that doesn't work either

$ cat test.c
#include <stdio.h>
main(){(void)fwrite("foo", 1, 1, stderr);}
$ gcc -O2 -Wall test.c -c
test.c:2:8: warning: ignoring return value of ‘fwrite’, declared with 
attribute warn_unused_result [-Wunused-result]

assigning it to a variable but not checking the variable no longer works with 
newer gcc and -Wunused-but-set-parameter

that's left the style i proposed where you use if() and an empty brace
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/binutils/attachments/20120331/6c08fc57/attachment.sig>


More information about the Binutils mailing list