Просмотр исходного кода

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
Родитель
Сommit
36ed6fe6eb
1 измененных файлов с 8 добавлено и 6 удалено
  1. 8 6
      m4/dpkg-compiler.m4

+ 8 - 6
m4/dpkg-compiler.m4

@@ -3,13 +3,15 @@
 
 # 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_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 \
 	 -Wvla -Winit-self -Wwrite-strings -Wcast-align"
 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
 		CXXFLAGS="$WFLAGS $WCXXFLAGS $CXXFLAGS"
 	fi
-fi])dnl
+fi
 ])
 
 # DPKG_COMPILER_OPTIMISATIONS