From 59145179a793820f25c55b286d70d1d278f275d5 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 13 Oct 2018 14:02:47 +0200 Subject: Pass -Wno-implicit-fallthrough when compiling bundled zlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s of no use to get warnings for 3pp code. --- Makefile.in | 1 + configure.ac | 10 +++++----- dev.mk.in | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile.in b/Makefile.in index 308fd562..dcec0af0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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) diff --git a/configure.ac b/configure.ac index 5481e113..8dfba4bc 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/dev.mk.in b/dev.mk.in index 9bd341ec..4ca34a46 100644 --- 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 -- cgit v1.2.1