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]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]