diff options
author | Bruno Haible <bruno@clisp.org> | 2011-02-13 23:21:20 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-02-15 02:31:02 +0100 |
commit | f6a5a124d0cb326acd4dfa9ce3276baa26734b16 (patch) | |
tree | 51c769d136f2dc11801b2191686cd03955c2d82b /lib/hash.h | |
parent | e7a3c769e98d9054d3d9f6983e678397b0b7cb94 (diff) | |
download | gnulib-f6a5a124d0cb326acd4dfa9ce3276baa26734b16.tar.gz |
Don't interfere with a program's definition of __attribute__.
* lib/argp.h (__attribute__): Remove definition.
(_GL_ATTRIBUTE_FORMAT): New macro.
(argp_error, __argp_error, argp_failure, __argp_failure): Use it.
* lib/argp-fmtstream.h (__attribute__): Remove definition.
(_GL_ATTRIBUTE_FORMAT): New macro.
(__argp_fmtstream_printf, argp_fmtstream_printf): Use it.
* lib/argp-help.c (hol_entry_long_iterate): Use __attribute__ only for
GCC 3 or newer.
* lib/error.h (__attribute__): Remove definition.
(_GL_ATTRIBUTE_FORMAT): New macro.
(error, error_at_line): Use it.
* lib/hash.h (__attribute__): Remove definition.
(ATTRIBUTE_WUR): Update definition. Define always.
* lib/openat.h (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
* lib/sigpipe-die.h (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
* lib/vasnprintf.h (__attribute__): Remove definition.
(_GL_ATTRIBUTE_FORMAT): New macro.
(asnprintf, vasnprintf): Use it.
* lib/xalloc.h (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
(ATTRIBUTE_MALLOC, ATTRIBUTE_ALLOC_SIZE): Define always.
* lib/xmemdup0.h (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
* lib/xprintf.h (__attribute__): Remove definition.
(_GL_ATTRIBUTE_FORMAT): New macro.
(xprintf, xvprintf, xfprintf, xvfprintf): Use it.
* lib/xstrtol.h (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
* lib/xvasprintf.h (__attribute__): Remove definition.
(_GL_ATTRIBUTE_FORMAT): New macro.
(xasprintf, xvasprintf): Use it.
* tests/test-argmatch.c (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
* tests/test-exclude.c (__attribute__): Remove definition.
(ATTRIBUTE_NORETURN): Update definition. Define always.
Reported by Paul Eggert.
Diffstat (limited to 'lib/hash.h')
-rw-r--r-- | lib/hash.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/hash.h b/lib/hash.h index 9c2f5b781f..19671f68d4 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -27,15 +27,12 @@ # include <stdio.h> # include <stdbool.h> -/* The warn_unused_result attribute appeared first in gcc-3.4.0 */ -# ifndef __attribute__ -# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) -# define __attribute__(x) -# endif -# endif - -# ifndef ATTRIBUTE_WUR +/* The __attribute__ feature is available in gcc versions 2.5 and later. + The warn_unused_result attribute appeared first in gcc-3.4.0. */ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # define ATTRIBUTE_WUR __attribute__ ((__warn_unused_result__)) +# else +# define ATTRIBUTE_WUR /* empty */ # endif typedef size_t (*Hash_hasher) (const void *, size_t); |