On 01/06/2011 03:15 PM, Eric Blake wrote:
> 
> +# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
> +#  define ignore_value(x) ((void) (x))
> +# else
>  static inline void _ignore_value (intptr_t p) { (void) p; }
> -# define ignore_value(x) _ignore_value ((intptr_t) x)
> +#  define ignore_value(x) \
> +     _ignore_value (({__typeof__(x) __x = (x); (intptr_t) __x;}))
> +# endif

In fact, the simpler:

#  define ignore_value(x) (({__typeof__(x) __x = (x);(void)__x;}))

works on coreutils, and has the added perk of silencing _wur on aggregates!

-- 
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to