This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libiberty]: Avoid 'right-hand operand of comma expression has no effect' when compiling regex.c
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 13 Mar 2014 22:33:15 +0100
- Subject: Re: [PATCH, libiberty]: Avoid 'right-hand operand of comma expression has no effect' when compiling regex.c
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4YHE2++2ZJAg2+gxdT8tso=-4ha3VsGLYhaB3TBLoCXxg at mail dot gmail dot com> <5322221D dot 6060708 at redhat dot com>
On Thu, Mar 13, 2014 at 10:24 PM, Pedro Alves <palves@redhat.com> wrote:
> On 03/13/2014 10:36 AM, Uros Bizjak wrote:
>> +# define bzero(s, n) (memset (s, '\0', n), (void) 0)
>
> AFAICS, the comma operator was only needed because of the
> intention to return 's'. If 's' is not be returned, then simply
>
> # define bzero(s, n) ((void) memset (s, '\0', n))
>
> should work.
I think that adding (void) is the best solution. I'll commit this
version as soon as bootstrap ends.
Thanks,
Uros.