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/xmemdup0.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/xmemdup0.h')
-rw-r--r-- | lib/xmemdup0.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/xmemdup0.h b/lib/xmemdup0.h index 8b500720e5..ff118a682b 100644 --- a/lib/xmemdup0.h +++ b/lib/xmemdup0.h @@ -25,14 +25,10 @@ extern "C" { # endif -# ifndef __attribute__ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) -# define __attribute__(x) -# endif -# endif - -# ifndef ATTRIBUTE_NORETURN +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) +# else +# define ATTRIBUTE_NORETURN /* empty */ # endif /* This function is always triggered when memory is exhausted. |