[Oisf-devel] [PATCH 5/8] configure: compile with -Wextra

Eric Leblond eleblond at edenwall.com
Mon Jan 11 10:11:35 UTC 2010


This patch modify CFLAGS to use -Wextra flag. To avoid problem
with "unused param" it disable this warning.
---
 configure.in |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 28218a9..4c612fd 100644
--- a/configure.in
+++ b/configure.in
@@ -23,7 +23,23 @@ AC_INIT(configure.in)
             exit 1
             ])
 
+    dnl get gcc version
+    AC_MSG_CHECKING([gcc version])
+            gccver=$($CC -dumpversion)
+            gccvermajor=$(echo $gccver | cut -d . -f1)
+            gccverminor=$(echo $gccver | cut -d . -f2)
+            gccvernum=$(expr $gccvermajor "*" 100 + $gccverminor)
+    AC_MSG_RESULT($gccver)
+
+    if test "$gccvernum" -ge "400"; then
+            dnl gcc 4.0 or later
+            CFLAGS="$CFLAGS -Wextra"
+    else
+            CFLAGS="$CFLAGS -W"
+    fi
+
     CFLAGS="$CFLAGS -Wall -fno-strict-aliasing"
+    CFLAGS="$CFLAGS -Wno-unused-parameter"
 
 # Checks for programs.
     AC_PROG_AWK
-- 
1.6.6



More information about the Oisf-devel mailing list