diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-02-07 00:18:12 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-02-07 00:18:12 +0100 |
| commit | 4c6d4cc27092ffbdd7be3483b83e355fbc115f4e (patch) | |
| tree | 8b2af8ad3894ec5f751ab2c2c0b5563e9fa6d149 /Source/Core/Common/StringUtil.h | |
| parent | 8ad6f154a4fe64564d18598bb5fab70cc89d70c4 (diff) | |
| parent | 70d2592ffbbb2252d5ac998ce4d3200175a5951c (diff) | |
Merge pull request #41 from Parlane/printf_warnings
Give StringFromFormat a printf format attribute.
Diffstat (limited to 'Source/Core/Common/StringUtil.h')
| -rw-r--r-- | Source/Core/Common/StringUtil.h | 9 |
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); |
