]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Pass -Wno-implicit-fallthrough when compiling bundled zlib
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 13 Oct 2018 12:02:47 +0000 (14:02 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 13 Oct 2018 12:02:47 +0000 (14:02 +0200)
It’s of no use to get warnings for 3pp code.

Makefile.in
configure.ac
dev.mk.in

index 308fd562e9cfd06e45375e12ccb01b401990fe39..dcec0af096435219b14e777ff8bf19786e67ded3 100644 (file)
@@ -114,6 +114,7 @@ clean:
 conf.c: confitems_lookup.c envtoconfitems_lookup.c
 
 $(zlib_objs): CPPFLAGS += -include config.h
+$(zlib_objs): CFLAGS += @no_implicit_fallthrough_warning@
 
 src/zlib/libz.a: $(zlib_objs)
        $(AR) cr $@ $(zlib_objs)
index 5481e113577ab44e5820159bc4e402dc63c4a3e8..8dfba4bcce538732369cac1e6a8342bcb98ed10f 100644 (file)
@@ -17,7 +17,7 @@ case $host in
 esac
 
 AC_SUBST(extra_libs)
-AC_SUBST(extra_cflags)
+AC_SUBST(no_implicit_fallthrough_warning)
 AC_SUBST(getopt_long_c)
 AC_SUBST(include_dev_mk)
 AC_SUBST(test_suites)
@@ -200,13 +200,13 @@ if test ! -f $srcdir/dev_mode_disabled && test "$RUN_FROM_BUILD_FARM" != yes; th
     version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
     echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
 
-    dnl Check for -Wimplicit-fallthrough and disable if exists
-    AC_MSG_CHECKING([whether C compiler supports -Wimplicit-fallthrough])
+    dnl Check for -Wno-implicit-fallthrough
+    AC_MSG_CHECKING([whether C compiler supports -Wno-implicit-fallthrough])
     saved_cflags=$CFLAGS
-    CFLAGS=-Wimplicit-fallthrough
+    CFLAGS=-Wno-implicit-fallthrough
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
         [AC_MSG_RESULT([yes])]
-        [extra_cflags="-Wno-error=implicit-fallthrough"],
+        [no_implicit_fallthrough_warning="-Wno-implicit-fallthrough"],
         [AC_MSG_RESULT([no])]
     )
     CFLAGS=$saved_cflags
index 9bd341ec08413ee53bc62d87989f671af780fd32..4ca34a465869a4c07569091d677fef52e0a64736 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -1,6 +1,6 @@
 # GNU make syntax reigns in this file.
 
-all_cflags += -Werror @extra_cflags@
+all_cflags += -Werror
 all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
 
 A2X = a2x