From e7d39c929204f631d11e2f87b2f8e972b1abbf6e Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Thu, 27 Jun 2013 09:41:46 +0200 Subject: Introduce Q_ATTRIBUTE_FORMAT_PRINTF Removes a lot of copy-paste code for flagging printf style functions. Change-Id: Iecc1e312d1f28b5cbb6b297039f1cdbbc888f843 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.h | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src/corelib/tools/qstring.h') diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 3140af084b..0a0a609728 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -302,24 +302,8 @@ public: const QString &a4, const QString &a5, const QString &a6, const QString &a7, const QString &a8, const QString &a9) const Q_REQUIRED_RESULT; - 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 - ; + QString &vsprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(2, 0); + QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3); int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; -- cgit v1.2.3