This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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] | |
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
Attachment:
signature.asc
Description: This is a digitally signed message part.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |