bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] ignore_value vs (void) [was: bug#15970: bug#15970: Crash i


From: Eric Blake
Subject: Re: [Bug-tar] ignore_value vs (void) [was: bug#15970: bug#15970: Crash in gettext() after fork() on Mac OS X]
Date: Wed, 27 Nov 2013 10:11:42 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 11/27/2013 10:05 AM, Joerg Schilling wrote:
> If you like to stay in an environment that is based on GCC only, you may use 
> ignore_value(). If you however like to write portable code, you cannot expect 
> something like ignore_value() to be available.

False.  Gnulib already takes care of that; it #defines ignore_value(e)
to ((void)(e)) on all non-gcc compilers.  In other words, ignore_value()
is portable to ANY standards-compliant compiler, and ALSO has the
benefit of shutting up warnings on as many compilers as gnulib knows how
to test.

> Given the fact that other 
> compilers honor the (void) cast,

GCC honors (void) casting - but that doesn't shut up the warning.  Just
because the standards require (void)expression to compile (and gcc
compiles it just fine) doesn't mean that the compiler can't warn about
it being suspicious.

> it seems that gcc is trying to be different in 
> a way that just causes pain but that does not give extra value.

Maybe, but that cat is already out of the bag, and cross-posting to
these lists is not the effective forum to do anything about it.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]