Subject: bug#15970: ignore_value vs (void) [was: [Bug-tar] bug#15970: bug#15970: Crash in gettext() after fork() on Mac OS X]

From: Eric Blake <[email-masked]>
Date: Wed, 27 Nov 2013 10:11:42 -0700

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