[Scummvm-cvs-logs] SF.net SVN: scummvm: [21139] scummvm/trunk/common

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Mar 8 02:01:02 CET 2006


Revision: 21139
Author:   fingolfin
Date:     2006-03-08 02:00:12 -0800 (Wed, 08 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21139&view=rev

Log Message:
-----------
Check format string in calls of debug/error (adapted from patch #1445422)

Modified Paths:
--------------
    scummvm/trunk/common/scummsys.h
    scummvm/trunk/common/util.h
Modified: scummvm/trunk/common/scummsys.h
===================================================================
--- scummvm/trunk/common/scummsys.h	2006-03-08 01:49:22 UTC (rev 21138)
+++ scummvm/trunk/common/scummsys.h	2006-03-08 10:00:12 UTC (rev 21139)
@@ -369,8 +369,9 @@
 #if defined(__GNUC__)
 	#define GCC_PACK __attribute__((packed))
 	#define NORETURN __attribute__((__noreturn__)) 
+	#define GCC_PRINTF(x,y) __attribute__((format(printf, x, y)))
 #else
-	#define GCC_PACK
+	#define GCC_PRINTF(x,y)
 #endif
 
 

Modified: scummvm/trunk/common/util.h
===================================================================
--- scummvm/trunk/common/util.h	2006-03-08 01:49:22 UTC (rev 21138)
+++ scummvm/trunk/common/util.h	2006-03-08 10:00:12 UTC (rev 21139)
@@ -261,21 +261,20 @@
 }	// End of namespace Common
 
 
-
 #if defined(__GNUC__)
-void CDECL error(const char *s, ...) NORETURN;
+void CDECL error(const char *s, ...) GCC_PRINTF(1, 2) NORETURN;
 #else
 void CDECL NORETURN error(const char *s, ...);
 #endif
 
-void CDECL warning(const char *s, ...);
+void CDECL warning(const char *s, ...) GCC_PRINTF(1, 2);
 
-void CDECL debug(int level, const char *s, ...);
-void CDECL debug(const char *s, ...);
-void CDECL debugN(int level, const char *s, ...);
+void CDECL debug(int level, const char *s, ...) GCC_PRINTF(2, 3);
+void CDECL debug(const char *s, ...) GCC_PRINTF(1, 2);
+void CDECL debugN(int level, const char *s, ...) GCC_PRINTF(2, 3);
 void checkHeap();
 
-void CDECL debugC(int level, uint32 engine_level, const char *s, ...);
+void CDECL debugC(int level, uint32 engine_level, const char *s, ...) GCC_PRINTF(3, 4);
 
 extern int gDebugLevel;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list