[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240306164950.GB3659677@dev-arch.thelio-3990X>
Date: Wed, 6 Mar 2024 09:49:50 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>, llvm@...ts.linux.dev
Subject: Re: [PATCH] kbuild: remove GCC's default -Wpacked-bitfield-compat
flag
On Wed, Mar 06, 2024 at 09:47:09PM +0900, Masahiro Yamada wrote:
> Commit 4a5838ad9d2d ("kbuild: Add extra gcc checks") added the
> -Wpacked-bitfield-compat flag.
>
> 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@...nel.org>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
> ---
>
> scripts/Makefile.extrawarn | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index a9e552a1e910..8192b497aae8 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -185,7 +185,6 @@ KBUILD_CFLAGS += -Wpointer-arith
> KBUILD_CFLAGS += -Wredundant-decls
> KBUILD_CFLAGS += -Wsign-compare
> KBUILD_CFLAGS += -Wswitch-default
> -KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat)
>
> KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3
>
> --
> 2.40.1
>
>
Powered by blists - more mailing lists