summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.h
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2014-02-07 01:10:04 +1300
committerMatthew Parlane <parlane@gmail.com>2014-02-07 01:10:04 +1300
commit09cc7e2ddfa40190172eb38d4448c35f5e761cdb (patch)
treeb144de51bdc44c9f5d8de6c80b45a44c50c021bf /Source/Core/Common/StringUtil.h
parent2356e2950f650a8a624d3d7a7dde268f682a54f9 (diff)
Give StringFromFormat a printf format attribute.
It gives StringFromFormat printf style arguments that should be type-checked against a format string.
Diffstat (limited to 'Source/Core/Common/StringUtil.h')
-rw-r--r--Source/Core/Common/StringUtil.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h
index 46ed382724..7846cbee3d 100644
--- a/Source/Core/Common/StringUtil.h
+++ b/Source/Core/Common/StringUtil.h
@@ -14,7 +14,14 @@
#include "Common.h"
-std::string StringFromFormat(const char* format, ...);
+std::string StringFromFormat(const char* format, ...)
+#if !defined _WIN32
+// On compilers that support function attributes, this gives StringFromFormat
+// the same errors and warnings that printf would give.
+ __attribute__ ((__format__(printf, 1, 2)))
+#endif
+;
+
// Cheap!
bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list args);