This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: silence warning in libiberty/pex-unix.c
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: bje at au1 dot ibm dot com (Ben Elliston)
- Cc: binutils at sourceware dot org, gcc-patches at gcc dot gnu dot org, iant at google dot com
- Date: Thu, 11 Jan 2007 19:57:08 -0500 (EST)
- Subject: Re: PATCH: silence warning in libiberty/pex-unix.c
>
> The last patch to to libiberty to fix an ignored function result. This
> seems like a reasonable way to handle write failing: call _exit
> prematurely, just as the function does at completion anyway. Okay for
> the trunk?
Actually I think this is a wrong warning because you really don't need
to check for an error until the end and since we are already exiting
after the write, there is no need to check for an error.
A better patch would be to just to cast the function to (void) and then
we ignore the problem. If someone in glibc land thought it would be
fun to warn about write's return value being ignored, they need to rethink
it because you really only need to check for an error at the end. This
would the same as doing checking the return value of printf all the time.
Thanks,
Andrew Pinski