From: Nathan Chancellor <nathan@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>
Subject: Re: [PATCH 2/2] kbuild: add -Wundef to KBUILD_CPPFLAGS for W=1 builds
Date: Fri, 9 Dec 2022 10:49:16 -0700 [thread overview]
Message-ID: <Y5N1HGYyJGgm3qVH@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20221206040731.442499-2-masahiroy@kernel.org>
On Tue, Dec 06, 2022 at 01:07:31PM +0900, Masahiro Yamada wrote:
> The use of an undefined macro in an #if directive is warned, but only
> in *.c files. No warning from other files such as *.S, *.lds.S.
>
> Since -Wundef is a preprocessor-related warning, it should be added to
> KBUILD_CPPFLAGS instead of KBUILD_CFLAGS.
>
> My previous attempt [1] uncovered several warnings, and could not finish
> fixing them all.
>
> This commit adds -Wundef to KBUILD_CPPFLAGS for W=1 builds in order to
> block new breakages. (The kbuild test robot tests with W=1)
>
> We can fix the warnings one by one. After we fix all of them, we can
> make this default in the top Makefile, and remove -Wundef from
> KBUILD_CFLAGS.
>
> [1]: https://lore.kernel.org/all/20221012180118.331005-2-masahiroy@kernel.org/
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Looks like the robot already found a few so this clearly works as
intended.
> ---
>
> scripts/Makefile.extrawarn | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 6bbba36c5969..40cd13eca82e 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -38,6 +38,7 @@ KBUILD_CFLAGS += -Wno-sign-compare
> KBUILD_CFLAGS += -Wno-type-limits
> KBUILD_CFLAGS += -Wno-shift-negative-value
>
> +KBUILD_CPPFLAGS += -Wundef
> KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
>
> else
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2022-12-09 17:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 4:07 [PATCH 1/2] kbuild: move -Werror from KBUILD_CFLAGS to KBUILD_CPPFLAGS Masahiro Yamada
2022-12-06 4:07 ` [PATCH 2/2] kbuild: add -Wundef to KBUILD_CPPFLAGS for W=1 builds Masahiro Yamada
2022-12-06 10:42 ` kernel test robot
2022-12-06 10:42 ` kernel test robot
2022-12-09 17:49 ` Nathan Chancellor [this message]
2022-12-09 18:29 ` Nick Desaulniers
2022-12-09 17:47 ` [PATCH 1/2] kbuild: move -Werror from KBUILD_CFLAGS to KBUILD_CPPFLAGS Nathan Chancellor
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=Y5N1HGYyJGgm3qVH@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@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
all inboxes | Powered by JetHome®