From fc89a7a86d56c21208414280ebf78008687d1ab6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 16 Sep 2018 20:42:39 +0200 Subject: [PATCH] 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. --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.47.2