[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ignore-value: prefer GCC version back through 2.0
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] ignore-value: prefer GCC version back through 2.0 |
Date: |
Thu, 28 Nov 2013 00:24:29 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 11/27/2013 10:55 PM, Paul Eggert wrote:
> -/* The __attribute__((__warn_unused_result__)) feature
> - is available in gcc versions 3.4 and newer,
> - while the typeof feature has been available since 2.7 at least. */
> -#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
> +/* 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. */
> +#if 2 <= __GNUC__
> # define ignore_value(x) \
> (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
> #else
>
My thinking at the time was to use the complicated one only where needed (>=
3.4).
But the above should not cause issues.
thanks,
Pádraig.