Description: Add printf-format attribute
 The compiler needs to get more information for function declaration to
 help to find printf specific format attacks.
Forwarded: not-needed
Author: Sven Eckelmann <sven@narfation.org>

---
diff --git a/src/Debugger.cpp b/src/Debugger.cpp
index d68a89b22690b193e5222d6f9dc3fc7bb4e5f04e..fda064399150b6677cceaeb671043b90958368ff 100755
--- a/src/Debugger.cpp
+++ b/src/Debugger.cpp
@@ -1014,7 +1014,6 @@ void debug_keys ()
 //
 // output - output debugger text
 //
-
 void output (float x, float y, BOOL scale, const char *fmt, ...)
 {
   va_list ap;
diff --git a/src/Debugger.h b/src/Debugger.h
index 15539be4f59a8b0f3d87bb8a8c6287b40c7068c4..875c6deeeacd17fc2c1c66647646b89920737fa0 100644
--- a/src/Debugger.h
+++ b/src/Debugger.h
@@ -133,5 +133,5 @@ void debug_capture ();
 void debug_cacheviewer ();
 void debug_mouse ();
 void debug_keys ();
-void output (float x, float y, BOOL scale, const char *fmt, ...);
+void output (float x, float y, BOOL scale, const char *fmt, ...) __attribute__ ((format (printf, 4, 5)));
 
diff --git a/src/Gfx1.3.h b/src/Gfx1.3.h
index f8d629fe9686e9f2fb6f8dba8c2172f93393db66..fee99153c0088ad0af12658b38db2ce01ac7d972 100755
--- a/src/Gfx1.3.h
+++ b/src/Gfx1.3.h
@@ -273,6 +273,7 @@ extern std::ofstream rdp_err;
 
 
 #ifdef RDP_LOGGING
+__inline void FRDP (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 __inline void FRDP (const char *fmt, ...)
 {
 #ifdef RDP_LOGGING
@@ -289,6 +290,7 @@ __inline void FRDP (const char *fmt, ...)
     va_end(ap);
 #endif
 }
+__inline void FRDP_E (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 __inline void FRDP_E (const char *fmt, ...)
 {
 #ifdef RDP_ERROR_LOG
diff --git a/src/m64p.h b/src/m64p.h
index 39573e06f61c45eb13d1b51b23c1c86edb356438..422be9e252cdd538a504ae2e3b630687badda45a 100755
--- a/src/m64p.h
+++ b/src/m64p.h
@@ -37,7 +37,7 @@
 #define VIDEXT_API_VERSION       0x030000
 
 #define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)
-void WriteLog(m64p_msg_level level, const char *msg, ...);
+void WriteLog(m64p_msg_level level, const char *msg, ...) __attribute__ ((format (printf, 2, 3)));
 
 //The Glide API originally used an integer to pick an enumerated resolution.
 //To accomodate arbitrary resolutions, pack it into a 32-bit struct
diff --git a/src/wrapper/main.h b/src/wrapper/main.h
index a5333f27162b89703241bf126f0c61b6125d8026..28c045a3fef9a03741199a1bc66016aa5df44b37 100644
--- a/src/wrapper/main.h
+++ b/src/wrapper/main.h
@@ -92,8 +92,7 @@ extern int buffer_cleared; // mark that the buffer has been cleared, used to che
 
 #include "glide.h"
 
-void display_warning(const unsigned char *text, ...);
-void display_warning(const char *text, ...);
+void display_warning(const char *text, ...) __attribute__ ((format (printf, 1, 2)));
 void init_geometry();
 void init_textures();
 void init_combiner();
@@ -283,7 +282,7 @@ grConstantColorValueExt(GrChipID_t    tmu,
 #ifdef LOGGING
 void OPEN_LOG();
 void CLOSE_LOG();
-void LOG(char *text, ...);
+void LOG(char *text, ...) __attribute__ ((format (printf, 1, 2)));
 #else // LOGGING
 #define OPEN_LOG()
 #define CLOSE_LOG()
