summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-03-07 09:46:44 +0100
committerWerner Koch <wk@gnupg.org>2014-03-07 16:40:10 +0100
commit36372dcb2f75a659b7ace0e9c46f07bb431d009c (patch)
treeb18143cac483a4ce6b1dcd221c9f72db9205d390 /common
parentw32: Silence warnings about unused vars. (diff)
downloadgnupg2-36372dcb2f75a659b7ace0e9c46f07bb431d009c.tar.xz
gnupg2-36372dcb2f75a659b7ace0e9c46f07bb431d009c.zip
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.
Diffstat (limited to 'common')
-rw-r--r--common/mischelp.h11
1 files 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 )