PATCH: silence warning in libiberty/pex-unix.c

Andrew Pinski pinskia@physics.uc.edu
Fri Jan 12 00:56:00 GMT 2007
> 
> 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



More information about the Binutils mailing list