btrfs-progs: Makefile: Add -Wimplicit-fallthrough
Avoid introducing new cases of implicit fallthrough by having this flag always set, though a conditional check is needed to avoid build breakage on older compilers or on CI. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
575b6e0e51
commit
c052b38418
4
Makefile
4
Makefile
|
@ -78,6 +78,9 @@ TOPDIR := .
|
||||||
DISABLE_WARNING_FLAGS := $(call cc-disable-warning, format-truncation) \
|
DISABLE_WARNING_FLAGS := $(call cc-disable-warning, format-truncation) \
|
||||||
$(call cc-disable-warning, address-of-packed-member)
|
$(call cc-disable-warning, address-of-packed-member)
|
||||||
|
|
||||||
|
# Warnings that we want by default
|
||||||
|
ENABLE_WARNING_FLAGS := $(call cc-option, -Wimplicit-fallthrough)
|
||||||
|
|
||||||
# Common build flags
|
# Common build flags
|
||||||
CFLAGS = $(SUBST_CFLAGS) \
|
CFLAGS = $(SUBST_CFLAGS) \
|
||||||
$(CSTD) \
|
$(CSTD) \
|
||||||
|
@ -89,6 +92,7 @@ CFLAGS = $(SUBST_CFLAGS) \
|
||||||
-I$(TOPDIR) \
|
-I$(TOPDIR) \
|
||||||
-I$(TOPDIR)/libbtrfsutil \
|
-I$(TOPDIR)/libbtrfsutil \
|
||||||
$(DISABLE_WARNING_FLAGS) \
|
$(DISABLE_WARNING_FLAGS) \
|
||||||
|
$(ENABLE_WARNING_FLAGS) \
|
||||||
$(EXTRAWARN_CFLAGS) \
|
$(EXTRAWARN_CFLAGS) \
|
||||||
$(DEBUG_CFLAGS_INTERNAL) \
|
$(DEBUG_CFLAGS_INTERNAL) \
|
||||||
$(EXTRA_CFLAGS)
|
$(EXTRA_CFLAGS)
|
||||||
|
|
Loading…
Reference in New Issue