================================================================= This does not fully work yet, there is at least the libbz2 code left to be handled. But this patch helps to let CI find more places where we need annotations. =================================================================
C's implicit fallthrough behaviour in switch/case statements can lead to subtle bugs. Quite some while ago many compilers introduced warnings in those cases, requiring intentional fallthrough's to be annotated. So far we were not enabling that compiler option, so many ambiguities and some bugs in the code went unnoticed. With all places that produced warnings fixed or annotated now, we can add this compiler option to the build flags, to find new ambiguities early, before the code gets merged. Signed-off-by: Andre Przywara <andre.przyw...@arm.com> --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7d83ce16721..46c48556788 100644 --- a/Makefile +++ b/Makefile @@ -808,6 +808,7 @@ endif # These warnings generated too much noise in a regular build. # Use make W=1 to enable them (see scripts/Makefile.extrawarn) KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) +KBUILD_CFLAGS += -Wimplicit-fallthrough # Prohibit date/time macros, which would make the build non-deterministic KBUILD_CFLAGS += $(call cc-option,-Werror=date-time) -- 2.25.1