summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qlogging.h20
-rw-r--r--src/corelib/tools/qstring.h8
2 files changed, 28 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
;
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index ac49bdcdf6..d8aaa929dc 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -298,12 +298,20 @@ public:
QString &vsprintf(const char *format, va_list ap)
#if defined(Q_CC_GNU) && !defined(__INSURE__)
+# if defined(Q_CC_MINGW) && !defined(Q_CC_CLANG)
+ __attribute__ ((format (gnu_printf, 2, 0)))
+# else
__attribute__ ((format (printf, 2, 0)))
+# endif
#endif
;
QString &sprintf(const char *format, ...)
#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
;