Add _X_ATTRIBUTE_PRINTF attributes to debug functions.

PseudoramiXExtensionInit() is not defined in extinit.h if it won't be
used and we get a compiler warning when compiling the pseudoramiX code.

Signed-off-by: Keith Packard <[email protected]>
---
 Makefile.am               | 6 +++++-
 configure.ac              | 2 ++
 pseudoramiX/pseudoramiX.c | 8 ++++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 5bf760b..641cc00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,6 +25,10 @@ if PRESENT
 PRESENT_DIR=present
 endif
 
+if PSEUDORAMIX
+PSEUDORAMIX_DIR=pseudoramiX
+endif
+
 SUBDIRS = \
        doc \
        man \
@@ -35,11 +39,11 @@ SUBDIRS = \
        Xext \
        miext \
        os \
-       pseudoramiX \
        randr \
        render  \
        Xi \
        xkb \
+       $(PSEUDORAMIX_DIR) \
        $(DBE_DIR) \
        $(RECORD_DIR) \
        xfixes \
diff --git a/configure.ac b/configure.ac
index 8bedd35..c2fb59e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2176,6 +2176,8 @@ if test "x$XQUARTZ" = xyes; then
        fi
 fi
 
+AM_CONDITIONAL(PSEUDORAMIX, [test "x$XQUARTZ" = xyes ])
+
 # Support for objc in autotools is minimal and not documented.
 OBJC='$(CC)'
 OBJCLD='$(CCLD)'
diff --git a/pseudoramiX/pseudoramiX.c b/pseudoramiX/pseudoramiX.c
index 23dbc73..f47c783 100644
--- a/pseudoramiX/pseudoramiX.c
+++ b/pseudoramiX/pseudoramiX.c
@@ -100,6 +100,10 @@ static unsigned long pseudoramiXGeneration = 0;
 
 static void
 PseudoramiXTrace(const char *format, ...)
+    _X_ATTRIBUTE_PRINTF(1, 2);
+
+static void
+PseudoramiXTrace(const char *format, ...)
 {
     va_list ap;
 
@@ -110,6 +114,10 @@ PseudoramiXTrace(const char *format, ...)
 
 static void
 PseudoramiXDebug(const char *format, ...)
+    _X_ATTRIBUTE_PRINTF(1, 2);
+
+static void
+PseudoramiXDebug(const char *format, ...)
 {
     va_list ap;
 
-- 
1.8.4.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to