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, libiberty: eliminate build warning


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


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