From: Bruno Haible Date: Sat, 9 May 2020 11:22:49 +0000 (+0200) Subject: Remove redundant definitions of _GL_ATTRIBUTE_FORMAT. X-Git-Tag: v1.0~4113 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=598afc1407a86340f948e5545f19c06afe13e059;p=gnulib.git Remove redundant definitions of _GL_ATTRIBUTE_FORMAT. * lib/argp.h (_GL_ATTRIBUTE_FORMAT): Remove macro. * lib/argp-fmtstream.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-snprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-vasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-vsnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/c-xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/error.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/parse-datetime.y (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/xprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. * lib/xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. --- diff --git a/ChangeLog b/ChangeLog index dff097df28..85c5af9885 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2020-05-09 Bruno Haible + + Remove redundant definitions of _GL_ATTRIBUTE_FORMAT. + * lib/argp.h (_GL_ATTRIBUTE_FORMAT): Remove macro. + * lib/argp-fmtstream.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/c-snprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/c-vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/c-vasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/c-vsnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/c-xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/error.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/parse-datetime.y (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/vasnprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/xprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + * lib/xvasprintf.h (_GL_ATTRIBUTE_FORMAT): Likewise. + 2020-05-09 Bruno Haible Remove redundant definitions of _GL_ATTRIBUTE_ALLOC_SIZE. diff --git a/lib/argp-fmtstream.h b/lib/argp-fmtstream.h index e7713c4fd8..8e4bc0dd4a 100644 --- a/lib/argp-fmtstream.h +++ b/lib/argp-fmtstream.h @@ -28,18 +28,6 @@ #include #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H) /* line_wrap_stream is available, so use that. */ #define ARGP_FMTSTREAM_USE_LINEWRAP diff --git a/lib/argp.h b/lib/argp.h index 4cc65639bc..808c900b78 100644 --- a/lib/argp.h +++ b/lib/argp.h @@ -34,18 +34,6 @@ # define __NTH(fct) fct __THROW #endif -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - /* GCC 2.95 and later have "__restrict"; C99 compilers have "restrict", and "configure" may have defined "restrict". Other compilers use __restrict, __restrict__, and _Restrict, and diff --git a/lib/c-snprintf.h b/lib/c-snprintf.h index d82f35408b..e03ef8897f 100644 --- a/lib/c-snprintf.h +++ b/lib/c-snprintf.h @@ -20,18 +20,6 @@ /* Get size_t. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/c-vasnprintf.h b/lib/c-vasnprintf.h index 0f58fb8257..b9853f6a4c 100644 --- a/lib/c-vasnprintf.h +++ b/lib/c-vasnprintf.h @@ -23,18 +23,6 @@ /* Get size_t. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/c-vasprintf.h b/lib/c-vasprintf.h index 3b5b5f7a68..588fbf01d9 100644 --- a/lib/c-vasprintf.h +++ b/lib/c-vasprintf.h @@ -20,18 +20,6 @@ /* Get va_list. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/c-vsnprintf.h b/lib/c-vsnprintf.h index e296871b37..6e39102b85 100644 --- a/lib/c-vsnprintf.h +++ b/lib/c-vsnprintf.h @@ -23,18 +23,6 @@ /* Get va_list. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/c-xvasprintf.h b/lib/c-xvasprintf.h index d8f64cd02f..1d3a551ffc 100644 --- a/lib/c-xvasprintf.h +++ b/lib/c-xvasprintf.h @@ -20,18 +20,6 @@ /* Get va_list. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/error.h b/lib/error.h index bad47a16dd..a351606f81 100644 --- a/lib/error.h +++ b/lib/error.h @@ -19,18 +19,6 @@ #ifndef _ERROR_H #define _ERROR_H 1 -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - /* On mingw, the flavor of printf depends on whether the extensions module * is in use; the check for determines the witness macro. */ #ifndef _GL_ATTRIBUTE_SPEC_PRINTF diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y index 206ff2048f..0c62467422 100644 --- a/lib/parse-datetime.y +++ b/lib/parse-datetime.y @@ -82,18 +82,6 @@ # define _STDLIB_H 1 #endif -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - Enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - /* Shift A right by B bits portably, by dividing A by 2**B and truncating towards minus infinity. A and B should be free of side effects, and B should be in the range 0 <= B <= INT_BITS - 2, where diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h index 37777c9324..5be0553987 100644 --- a/lib/vasnprintf.h +++ b/lib/vasnprintf.h @@ -23,18 +23,6 @@ /* Get size_t. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif diff --git a/lib/xprintf.h b/lib/xprintf.h index 18ca05cfb9..d0615b4f90 100644 --- a/lib/xprintf.h +++ b/lib/xprintf.h @@ -20,18 +20,6 @@ #include #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - extern int xprintf (char const *restrict format, ...) _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 2)); extern int xvprintf (char const *restrict format, va_list args) diff --git a/lib/xvasprintf.h b/lib/xvasprintf.h index 8a64f535e1..ff43d1bbc4 100644 --- a/lib/xvasprintf.h +++ b/lib/xvasprintf.h @@ -20,18 +20,6 @@ /* Get va_list. */ #include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - #ifdef __cplusplus extern "C" { #endif