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
signature.asc
Description: OpenPGP digital signature