[PATCH 24/25] Add some printf format attributes suggested by gcc

Alan Coopersmith alan.coopersmith at oracle.com
Sun Dec 11 10:16:37 PST 2011


Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 Xext/security.c                 |    2 +-
 hw/xfree86/common/xf86.h        |    2 +-
 hw/xfree86/common/xf86Config.c  |    2 +-
 hw/xfree86/common/xf86Xinput.h  |    2 +-
 hw/xfree86/parser/configProcs.h |    4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Xext/security.c b/Xext/security.c
index 63892aa..df5bd58 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -97,7 +97,7 @@ static const Mask SecurityClientMask = DixGetAttrAccess;
  *	Writes the message to the log file if security logging is on.
  */
 
-static void
+static void _X_ATTRIBUTE_PRINTF(1,2)
 SecurityAudit(const char *format, ...)
 {
     va_list args;
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index f216d5e..b711f05 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -232,7 +232,7 @@ extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
 extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
 extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
 extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
-		     const char *format, va_list args);
+		     const char *format, va_list args) _X_ATTRIBUTE_PRINTF(4,0);
 extern _X_EXPORT void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
 		    const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5);
 extern _X_EXPORT void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 94d2b15..569695c 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -552,7 +552,7 @@ xf86DriverlistFromCompile(void)
  *      Print a READABLE ErrorMessage!!!  All information that is 
  *      available is printed.
  */
-static void
+static void _X_ATTRIBUTE_PRINTF(1,2)
 xf86ConfigError(const char *msg, ...)
 {
     va_list ap;
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 909fb57..7d96fac 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -173,7 +173,7 @@ extern _X_EXPORT void xf86VIDrvMsgVerb(InputInfoPtr dev,
 				       MessageType type,
 				       int verb,
 				       const char *format,
-				       va_list args);
+				       va_list args) _X_ATTRIBUTE_PRINTF(4,0);
 
 /* xf86Option.c */
 extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts);
diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
index 114cdfe..d67acc6 100644
--- a/hw/xfree86/parser/configProcs.h
+++ b/hw/xfree86/parser/configProcs.h
@@ -95,8 +95,8 @@ int xf86getSubToken(char **comment);
 int xf86getSubTokenWithTab(char **comment, xf86ConfigSymTabRec *tab);
 void xf86unGetToken(int token);
 char *xf86tokenString(void);
-void xf86parseError(const char *format, ...);
-void xf86validationError(const char *format, ...);
+void xf86parseError(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,2);
+void xf86validationError(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,2);
 void xf86setSection(const char *section);
 int xf86getStringToken(xf86ConfigSymTabRec *tab);
 /* write.c */
-- 
1.7.3.2



More information about the xorg-devel mailing list