From: Felix Domke Date: Thu, 26 Jan 2006 12:57:21 +0000 (+0000) Subject: check format strings on eDebug-style functions X-Git-Tag: 2.6.0~4277 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/cd3f3a74f7399db378fc35f8d0cb458b737f8b1b check format strings on eDebug-style functions --- diff --git a/lib/base/eerror.h b/lib/base/eerror.h index ea5fcc51..91575878 100644 --- a/lib/base/eerror.h +++ b/lib/base/eerror.h @@ -25,7 +25,13 @@ #define NULL 0 #endif -void eFatal(const char* fmt, ...); +#ifndef SWIG +#define CHECKFORMAT __attribute__ ((__format__(__printf__, 1, 2))) +#else +#define CHECKFORMAT +#endif + +void CHECKFORMAT eFatal(const char*, ...); enum { lvlDebug=1, lvlWarning=2, lvlFatal=4 }; @@ -39,9 +45,9 @@ extern int logOutputConsole; #endif #ifdef DEBUG - void eDebug(const char* fmt, ...); - void eDebugNoNewLine(const char* fmt, ...); - void eWarning(const char* fmt, ...); + void CHECKFORMAT eDebug(const char*, ...); + void CHECKFORMAT eDebugNoNewLine(const char*, ...); + void CHECKFORMAT eWarning(const char*, ...); #ifndef SWIG #define ASSERT(x) { if (!(x)) eFatal("%s:%d ASSERTION %s FAILED!", __FILE__, __LINE__, #x); } #endif