From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Masahiro Yamada <masahiroy@kernel.org>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>,
llvm@lists.linux.dev
Subject: [PATCH] kbuild: remove GCC's default -Wpacked-bitfield-compat flag
Date: Wed, 6 Mar 2024 21:47:09 +0900 [thread overview]
Message-ID: <20240306124709.324448-1-masahiroy@kernel.org> (raw)
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@kernel.org>
---
| 1 -
1 file changed, 1 deletion(-)
--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
next reply other threads:[~2024-03-06 12:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 12:47 Masahiro Yamada [this message]
2024-03-06 16:49 ` [PATCH] kbuild: remove GCC's default -Wpacked-bitfield-compat flag Nathan Chancellor
2024-03-10 18:37 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240306124709.324448-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=justinstitt@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).