From d3b286cb434ed228e7b62cc70cb293e7a5554bfa Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 23 Feb 2018 02:22:38 +0000 Subject: Fix a bunch of compiler warnings and remove suppressions. --- toxcore/ccompat.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'toxcore/ccompat.h') diff --git a/toxcore/ccompat.h b/toxcore/ccompat.h index 90db8bc6..1ceb5a5a 100644 --- a/toxcore/ccompat.h +++ b/toxcore/ccompat.h @@ -13,7 +13,7 @@ // "function") is used. Note the semantic difference: alloca'd memory does not // get freed at the end of the declaration's scope. Do not use VLA() in loops or // you may run out of stack space. -#if !defined(_MSC_VER) && __STDC_VERSION__ >= 199901L +#if !defined(_MSC_VER) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L // C99 VLAs. #define VLA(type, name, size) type name[size] #define SIZEOF_VLA sizeof @@ -42,4 +42,10 @@ #define nullptr NULL #endif +#ifdef __GNUC__ +#define GNU_PRINTF __attribute__((__format__(__printf__, 6, 7))) +#else +#define GNU_PRINTF +#endif + #endif /* CCOMPAT_H */ -- cgit v1.2.3