Only enable implicit-fallthrough for gcc
It turns out that clang passes the configure test for
implicit-fallthrough=3, but then fails compilation.
Sigh.
Enabling it only for gcc (that supports it) is good enough to
keep the codebase clean.
@@ -151,8 +151,11 @@ if test "x$werror" != "xno"; then
AX_CHECK_COMPILE_FLAG(["-Wdouble-promotion"], [WERROR_CFLAGS="$WERROR_CFLAGS -Wdouble-promotion"])
AX_CHECK_COMPILE_FLAG(["-Wshadow"], [WERROR_CFLAGS="$WERROR_CFLAGS -Wshadow"])
AX_CHECK_COMPILE_FLAG(["-Wformat=2"], [WERROR_CFLAGS="$WERROR_CFLAGS -Wformat=2"])
+ # clang accepts =3 here, but fails on compile
+ if test "x$CC" == "xgcc"; then
AX_CHECK_COMPILE_FLAG(["-Wimplicit-fallthrough=3"], [WERROR_CFLAGS="$WERROR_CFLAGS -Wimplicit-fallthrough=3"])
fi
+fi
AC_SUBST(WERROR_CFLAGS)
# Do we have a pkg-config?
