]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add option for enabling more compiler warnings
authorAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 18:42:39 +0000 (20:42 +0200)
committerAnders F Björklund <anders.f.bjorklund@gmail.com>
Sun, 16 Sep 2018 18:58:20 +0000 (20:58 +0200)
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

index 345a5617186af8c95c59d8436ec9368d69be9e5d..89a914983e7e16869af42a5ddcb8ed1b9d6f48aa 100644 (file)
@@ -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