diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-06-23 11:51:27 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-06-23 11:53:41 -0700 |
commit | 7062e7a704fdff060759163a9c8a987604af3550 (patch) | |
tree | 3612a5549dfeb7b52e3105721b45f370e9ba8c96 /lib/ignore-value.h | |
parent | 51792d2f76e96d017ad9284b60812cfbed4cb618 (diff) | |
download | gnulib-7062e7a704fdff060759163a9c8a987604af3550.tar.gz |
ignore-value: port to gcc -pedantic
* lib/ignore-value.h (ignore_value):
Port to gcc -pedantic, by using __extension__.
Reindent as per usual gnulib style nowadays.
Simplify GCC version check.
Diffstat (limited to 'lib/ignore-value.h')
-rw-r--r-- | lib/ignore-value.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/ignore-value.h b/lib/ignore-value.h index 63ecde8513..ebd6bf42f5 100644 --- a/lib/ignore-value.h +++ b/lib/ignore-value.h @@ -33,15 +33,16 @@ declared with attribute warn_unused_result". */ #ifndef _GL_IGNORE_VALUE_H -# define _GL_IGNORE_VALUE_H +#define _GL_IGNORE_VALUE_H /* 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 __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) -# define ignore_value(x) ((void) (x)) -# else -# define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; })) -# endif +#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__) +# define ignore_value(x) \ + (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; })) +#else +# define ignore_value(x) ((void) (x)) +#endif #endif |