From 36372dcb2f75a659b7ace0e9c46f07bb431d009c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 7 Mar 2014 09:46:44 +0100 Subject: [PATCH] Use attribute __gnu_printf__ with our estream-printf functions. * common/mischelp.h (JNLIB_GCC_A_PRINTF): Use __gnu_printf__ (JNLIB_GCC_A_NR_PRINTF): Ditto. -- Our printf supports most of the GNU features and thus we can silence the warnings from mingw. --- common/mischelp.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/common/mischelp.h b/common/mischelp.h index dd1f3a620..e3c4fd198 100644 --- a/common/mischelp.h +++ b/common/mischelp.h @@ -55,9 +55,16 @@ time_t timegm (struct tm *tm); #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 ) # define JNLIB_GCC_M_FUNCTION 1 # define JNLIB_GCC_A_NR __attribute__ ((noreturn)) -# define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a))) -# define JNLIB_GCC_A_NR_PRINTF( f, a ) \ +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 ) +# define JNLIB_GCC_A_PRINTF( f, a ) \ + __attribute__ ((format (__gnu_printf__,f,a))) +# define JNLIB_GCC_A_NR_PRINTF( f, a ) \ + __attribute__ ((noreturn, format (__gnu_printf__,f,a))) +# else +# define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a))) +# define JNLIB_GCC_A_NR_PRINTF( f, a ) \ __attribute__ ((noreturn, format (printf,f,a))) +# endif #else # define JNLIB_GCC_A_NR # define JNLIB_GCC_A_PRINTF( f, a )