Browse Source

build: Enable additional warnings by default

The set of default warnings is quite safe, and should point out real
problems or stylistic ones. It's easy to forget, so let's enable them by
default. This will also not interfere with user settings as those will
override the defaults.
Guillem Jover 16 years ago
parent
commit
36ed6fe6eb
1 changed files with 8 additions and 6 deletions
  1. 8 6
      m4/dpkg-compiler.m4

+ 8 - 6
m4/dpkg-compiler.m4

@@ -3,13 +3,15 @@
 
 
 # DPKG_COMPILER_WARNINGS
 # DPKG_COMPILER_WARNINGS
 # ---------------------
 # ---------------------
-# Add configure option to enable additional compiler warnings and treat
-# them as errors.
+# Add configure option to disable additional compiler warnings.
 AC_DEFUN([DPKG_COMPILER_WARNINGS],
 AC_DEFUN([DPKG_COMPILER_WARNINGS],
 [AC_ARG_ENABLE(compiler-warnings,
 [AC_ARG_ENABLE(compiler-warnings,
-	AS_HELP_STRING([--enable-compiler-warnings],
-	               [Enable additional compiler warnings]),
-[WFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers \
+	AS_HELP_STRING([--disable-compiler-warnings],
+	               [Disable additional compiler warnings]),
+	[enable_compiler_warnings=$enableval],
+	[enable_compiler_warnings=yes])
+
+WFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers \
 	 -Wmissing-declarations -Wmissing-format-attribute \
 	 -Wmissing-declarations -Wmissing-format-attribute \
 	 -Wvla -Winit-self -Wwrite-strings -Wcast-align"
 	 -Wvla -Winit-self -Wwrite-strings -Wcast-align"
 WCFLAGS="-Wdeclaration-after-statement -Wnested-externs -Wbad-function-cast \
 WCFLAGS="-Wdeclaration-after-statement -Wnested-externs -Wbad-function-cast \
@@ -23,7 +25,7 @@ if test "x$enable_compiler_warnings" = "xyes"; then
 	if test "x$GXX" = "xyes"; then
 	if test "x$GXX" = "xyes"; then
 		CXXFLAGS="$WFLAGS $WCXXFLAGS $CXXFLAGS"
 		CXXFLAGS="$WFLAGS $WCXXFLAGS $CXXFLAGS"
 	fi
 	fi
-fi])dnl
+fi
 ])
 ])
 
 
 # DPKG_COMPILER_OPTIMISATIONS
 # DPKG_COMPILER_OPTIMISATIONS