From 4a24fcd6cf5620964e71361c57c2b273225dc47a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 19 Jan 2010 03:15:05 +0100 Subject: [PATCH] Avoid a link error due to the __printf__ symbol. --- ChangeLog | 14 ++++++++++++++ lib/argp-fmtstream.h | 17 ++++++++--------- lib/argp.h | 17 ++++++++--------- lib/error.h | 15 +++++++-------- lib/stdio.in.h | 15 +++++++-------- lib/vasnprintf.h | 15 +++++++-------- lib/xprintf.h | 15 +++++++-------- lib/xvasprintf.h | 15 +++++++-------- 8 files changed, 65 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index 618d29e76..0ac094f89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2010-01-18 Bruno Haible + Avoid a link error due to the __printf__ symbol. + * lib/stdio.in.h (__attribute__): Define to empty also for gcc 2.5.x + and 2.6.x. + (__format__, __printf__): Remove definitions. + * lib/argp-fmtstream.h: Likewise. + * lib/argp.h: Likewise. + * lib/error.h: Likewise. + * lib/vasnprintf.h: Likewise. + * lib/xprintf.h: Likewise. + * lib/xvasprintf.h: Likewise. + Reported by Ralf Wildenhues . + +2010-01-18 Bruno Haible + Tests for module 'tanl'. * modules/tanl-tests: New file. * tests/test-tanl.c: New file. diff --git a/lib/argp-fmtstream.h b/lib/argp-fmtstream.h index 78b98db41..b913d1b25 100644 --- a/lib/argp-fmtstream.h +++ b/lib/argp-fmtstream.h @@ -29,15 +29,14 @@ #include #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__ -# define __format__ format -# define __printf__ printf +/* 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 __attribute__ 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 __attribute__(Spec) /* empty */ # endif #endif diff --git a/lib/argp.h b/lib/argp.h index cc9dc0715..3667224a9 100644 --- a/lib/argp.h +++ b/lib/argp.h @@ -35,15 +35,14 @@ #endif #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__ -# define __format__ format -# define __printf__ printf +/* 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 __attribute__ 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 __attribute__(Spec) /* empty */ # endif #endif diff --git a/lib/error.h b/lib/error.h index b4ae98241..9deef02d2 100644 --- a/lib/error.h +++ b/lib/error.h @@ -20,15 +20,14 @@ #define _ERROR_H 1 #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +/* 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 __attribute__ 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 __format__ format -# define __printf__ printf +# define __attribute__(Spec) /* empty */ # endif #endif diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 150016631..8fee7f7ed 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -45,15 +45,14 @@ #include #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +/* 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 __attribute__ 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 __format__ format -# define __printf__ printf +# define __attribute__(Spec) /* empty */ # endif #endif diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h index 9240e5f7f..5e3d291cf 100644 --- a/lib/vasnprintf.h +++ b/lib/vasnprintf.h @@ -25,15 +25,14 @@ #include #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +/* 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 __attribute__ 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 __format__ format -# define __printf__ printf +# define __attribute__(Spec) /* empty */ # endif #endif diff --git a/lib/xprintf.h b/lib/xprintf.h index d313d64fa..91ba55da5 100644 --- a/lib/xprintf.h +++ b/lib/xprintf.h @@ -21,15 +21,14 @@ #include #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +/* 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 __attribute__ 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 __format__ format -# define __printf__ printf +# define __attribute__(Spec) /* empty */ # endif #endif diff --git a/lib/xvasprintf.h b/lib/xvasprintf.h index acea80563..4f3b1360a 100644 --- a/lib/xvasprintf.h +++ b/lib/xvasprintf.h @@ -21,15 +21,14 @@ #include #ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -/* The __-protected variants of `format' and `printf' attributes - are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +/* 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 __attribute__ 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 __format__ format -# define __printf__ printf +# define __attribute__(Spec) /* empty */ # endif #endif -- 2.11.0