From c45e3fa9793a273a0eab40d1626bcda7d710552c Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 7 Aug 2014 03:39:13 +0200 Subject: Corrected several format-string errors through the code - Functions that expect a printf-style format string are now marked as such, so that gcc/clang will emit a warning warn you if you mismatch format string and arguments. Signed-off-by: Haru --- src/common/cbasetypes.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common/cbasetypes.h') diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 6ca67382f..18bc0b8cb 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -346,6 +346,19 @@ typedef char bool; #define NBBY 8 #endif +////////////////////////////////////////////////////////////////////////// +// Additional printf specifiers +#if defined(_MSC_VER) +#define PRIS_PREFIX "I" +#else // gcc +#define PRIS_PREFIX "z" +#endif +#define PRIdS PRIS_PREFIX "d" +#define PRIxS PRIS_PREFIX "x" +#define PRIuS PRIS_PREFIX "u" +#define PRIXS PRIS_PREFIX "X" +#define PRIoS PRIS_PREFIX "o" + ////////////////////////////////////////////////////////////////////////// // path separator -- cgit v1.2.3-70-g09d2