Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: remove GCC's default -Wpacked-bitfield-compat flag

Commit 4a5838ad9d2d ("kbuild: Add extra gcc checks") added the
-Wpacked-bitfield-compat flag, but there is no need to add it
explicitly.

GCC manual says:
"This warning is enabled by default. Use -Wno-packed-bitfield-compat
to disable this warning."

The test code in the manual:

struct foo
{
char a:4;
char b:8;
} __attribute__ ((packed));

... emits "note: offset of packed bit-field ‘b’ has changed in GCC 4.4"
without W=3.

Let's remove it, as it is a default with GCC.

Clang does not support this flag, so its removal will not affect Clang
builds.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>

-1
-1
scripts/Makefile.extrawarn
··· 187 187 KBUILD_CFLAGS += -Wredundant-decls 188 188 KBUILD_CFLAGS += -Wsign-compare 189 189 KBUILD_CFLAGS += -Wswitch-default 190 - KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat) 191 190 192 191 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3 193 192