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 88888343e5841d118a6f347f5cf90288f8068383..9e5463b3ffa5d8244e423058a6e04e94ca2a0550 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 153258a459193076f6411e219b5557034ea1ec1b..a39c324dc2320591491953215b4fb70fbb728990 100755
--- a/src/m64p.h
+++ b/src/m64p.h
@@ -37,7 +37,7 @@
 #define VIDEXT_API_VERSION       0x020000
 
 #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()
