btrfs-progs: build: disable -Waddress-of-packed-member by default

Gcc 9 adds the flag to default warnings and this produces a lot of
warnings that don't seem to be harmful as we know the address is
aligned, but this could be hidden in the function call chain.
It's still available under W=1.

Issue: #180
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2019-06-13 20:45:49 +02:00
parent 1d4796978c
commit 9a1d86a9ac
2 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,9 @@ TOPDIR := .
# Disable certain GCC 8 + glibc 2.28 warning for snprintf()
# where string truncation for snprintf() is expected.
DISABLE_WARNING_FLAGS := $(call cc-disable-warning, format-truncation)
# For GCC9 disable address-of-packed (under W=1)
DISABLE_WARNING_FLAGS := $(call cc-disable-warning, format-truncation) \
$(call cc-disable-warning, address-of-packed-member)
# Common build flags
CFLAGS = $(SUBST_CFLAGS) \

View File

@ -54,6 +54,7 @@ warning-1 += $(call cc-option, -Wunused-but-set-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers)
warning-1 += $(call cc-disable-warning, format-truncation)
warning-1 += $(call cc-disable-warning, sign-compare)
warning-2 += $(call cc-option, -Waddress-of-packed-member)
warning-2 := -Waggregate-return
warning-2 += -Wcast-align