On 11/27/2013 03:55 PM, Paul Eggert wrote: > While reading ignore-value.h I found that the code didn't match > the comments, so I took the liberty of changing both (!) > as described below. Please feel free to revert if I messed up. >
> + > + ignore-value: prefer GCC version back through 2.0 > + The code didn't match the comments, so I did a bit of software > + archaeology. GCC 2.0 seems to support __extension__ and > + __typeof__, so fix both code and comments to use 2.0. The important point wasn't whether __extension__ and __typeof__ worked, but... > +/* The __attribute__((__warn_unused_result__)) feature is available in > + gcc versions 3.4 and newer, while __typeof__ and __extension__ have > + been available since 2.0 at least. */ ...whether the circumlocution is needed in the first place. If gcc is older than 3.4, then there are no functions that can be marked in such a manner as to cause gcc to warn, and the simpler cast to (void) is just fine for such a compiler. Only when __warn_unused_result__ exists do we NEED the extensions to silence the warning. > +#if 2 <= __GNUC__ I'm not going to revert this unless someone complains of actual breakage, but the old code was correct and slightly more conservative. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature