This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]: Avoid 'right-hand operand of comma expression has no effect' when compiling regex.c


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.


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