From: Anders F Björklund Date: Sun, 16 Sep 2018 18:42:39 +0000 (+0200) Subject: Add option for enabling more compiler warnings X-Git-Tag: v3.5~26^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc89a7a86d56c21208414280ebf78008687d1ab6;p=thirdparty%2Fccache.git Add option for enabling more compiler warnings But remove some of the more annoying clang ones: 18 [-Werror,-Wconversion] 18 [-Werror,-Wdisabled-macro-expansion] 9 [-Werror,-Wdouble-promotion] 9 [-Werror,-Wfloat-conversion] 1 [-Werror,-Wformat-nonliteral] 52 [-Werror,-Wpadded] 29 [-Werror,-Wshorten-64-to-32] 75 [-Werror,-Wsign-conversion] It's not really feasible to enable every warning. --- diff --git a/configure.ac b/configure.ac index 345a56171..89a914983 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,19 @@ else CFLAGS="$CFLAGS -O" fi +AC_ARG_ENABLE(more_warnings, + [AS_HELP_STRING([--enable-more-warnings], + [enable more compiler warnings])]) +if test x${enable_more_warnings} = xyes; then + CFLAGS="$CFLAGS -Wextra -Wpedantic" + if test "$ac_compiler_clang" = yes; then + CFLAGS="$CFLAGS -Weverything" + CFLAGS="$CFLAGS -Wno-padded -Wno-disabled-macro-expansion -Wno-format-nonliteral" + CFLAGS="$CFLAGS -Wno-double-promotion -Wno-float-conversion" + CFLAGS="$CFLAGS -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion" + fi +fi + AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_SYS_WAIT