diff options
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r-- | src/corelib/global/qglobal.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 18e9ecae85..f5f144fe6b 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -467,6 +467,19 @@ typedef qptrdiff qintptr; # define QT_FASTCALL #endif +// enable gcc warnings for printf-style functions +#if defined(Q_CC_GNU) && !defined(__INSURE__) +# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG) +# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \ + __attribute__((format(gnu_printf, (A), (B)))) +# else +# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) \ + __attribute__((format(printf, (A), (B)))) +# endif +#else +# define Q_ATTRIBUTE_FORMAT_PRINTF(A, B) +#endif + //defines the type for the WNDPROC on windows //the alignment needs to be forced for sse2 to not crash with mingw #if defined(Q_OS_WIN) |