Give StringFromFormat a printf format attribute.

It gives StringFromFormat printf style arguments that should be type-checked against a format string.
This commit is contained in:
Matthew Parlane 2014-02-07 01:10:04 +13:00
parent 2356e2950f
commit 09cc7e2ddf
1 changed files with 8 additions and 1 deletions

View File

@ -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);