summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.h
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2013-04-25 21:00:24 +1000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-08 03:16:35 +0200
commit157596b1c2c0fb47067ff0438ec490a94048996e (patch)
treeb4c3a1454eb8e2d6a5ab266ce70bed3126ba9036 /src/corelib/global/qlogging.h
parent02679d93c4455d8d2f74002574a87801269fde56 (diff)
Specify gnu_printf for message formatting with MinGW
The custom printf formatter Qt ships supports e.g. %lld, which is part of gnu_printf, but not ms_printf. This fixes a lot of MinGW warnings. Change-Id: Iff600f20ac23ecb88c4b569d2e668f5d4af6ef27 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/corelib/global/qlogging.h')
-rw-r--r--src/corelib/global/qlogging.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index a6f244698d..2b798f9ea0 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -94,22 +94,38 @@ public:
void debug(const char *msg, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
void noDebug(const char *, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
{}
void warning(const char *msg, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
void critical(const char *msg, ...) const
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;
@@ -118,7 +134,11 @@ public:
#endif
void fatal(const char *msg, ...) const Q_DECL_NOTHROW
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 3)))
+# else
__attribute__ ((format (printf, 2, 3)))
+# endif
#endif
;