This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH, libiberty: eliminate build warning
- From: Ian Lance Taylor <iant at google dot com>
- To: Ben Elliston <bje at au1 dot ibm dot com>
- Cc: binutils <binutils at sourceware dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, dj at redhat dot com
- Date: Thu, 19 Nov 2009 20:38:50 -0800
- Subject: Re: PATCH, libiberty: eliminate build warning
- References: <1258625975.11150.8.camel@bapbop>
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