PATCH, libiberty: eliminate build warning

Ian Lance Taylor iant@google.com
Fri Nov 20 04:40:00 GMT 2009


Ben Elliston <bje@au1.ibm.com> writes:

>  pex_child_error (struct pex_obj *obj, const char *executable,
>  		 const char *errmsg, int err)
>  {
> -#define writeerr(s) (void) write (STDERR_FILE_NO, s, strlen (s))
> +#define writeerr(s) if (write (STDERR_FILE_NO, s, strlen (s))) {}

I think this needs a comment.  In context checking the return value of
write is completely pointless.

Personally, I would just write

  int err;
#define writeerr(s) err = write (STDERR_FILE_NO, s, strlen (s))  

Ian



More information about the Binutils mailing list