From 1652e5ae2497eb031fb0a4650ddca38f3f9c7234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sun, 12 Aug 2018 08:53:43 +0200 Subject: [PATCH 1/3] sht1x: Fix Wimplicit-fallthrough warning --- drivers/sht1x/sht1x_saul.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/sht1x/sht1x_saul.c b/drivers/sht1x/sht1x_saul.c index 7c0abd9255..50c52eea90 100644 --- a/drivers/sht1x/sht1x_saul.c +++ b/drivers/sht1x/sht1x_saul.c @@ -41,6 +41,7 @@ static int read(const sht1x_dev_t *dev, int16_t *temp, int16_t *hum) continue; case -ECANCELED: puts("[sht1x] Measurement times out"); + /* falls through */ default: /* Other failure, cannot recover so giving up */ return -1; From 9e5dd332cf166025aacaf958c10f1b03f64d7154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sun, 12 Aug 2018 00:26:52 +0200 Subject: [PATCH 2/3] Makefile.include: Set CCACHE_CPP2 to fix false warnings --- Makefile.include | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile.include b/Makefile.include index 137ad480bc..aa34309140 100644 --- a/Makefile.include +++ b/Makefile.include @@ -248,6 +248,16 @@ include $(RIOTCPU)/$(CPU)/Makefile.include # Import all toolchain settings include $(RIOTMAKE)/toolchain/$(TOOLCHAIN).inc.mk +# Tell ccache to pass the original file to the compiler, instead of passing the +# preprocessed code. Without this setting, the compilation will fail with +# -Wimplicit-fallthrough warnings even when the fall through case is properly +# commented because the preprocessor has stripped the comments from the code. +# This also fixes some other false warnings when compiling with LLVM/Clang. +# The environment variable only affects builds with ccache (e.g. on CI/Murdock). +# Non cached builds are not affected in any way. +# For more information, see http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html +export CCACHE_CPP2=yes + # get number of interfaces straight before resolving dependencies GNRC_NETIF_NUMOF ?= 1 From dda55731ff59169addb919982ef5646fc373d541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Fri, 15 Jun 2018 01:11:26 +0200 Subject: [PATCH 3/3] Makefile.include: Remove -Wno-implicit-fallthrough --- Makefile.include | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile.include b/Makefile.include index aa34309140..35edb0c0e9 100644 --- a/Makefile.include +++ b/Makefile.include @@ -141,10 +141,6 @@ ifeq ($(WPEDANTIC),1) CFLAGS += -Wpedantic endif -# remove this once codebase is adapted -CFLAGS += -Wno-implicit-fallthrough -CXXFLAGS += -Wno-implicit-fallthrough - ifneq (10,$(if $(RIOT_VERSION),1,0)$(if $(__RIOTBUILD_FLAG),1,0)) # Provide a shallow sanity check. You cannot call `make` in a module directory.