public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] [v3] kbuild: enable more warnings by default
@ 2024-04-15 12:20 Arnd Bergmann
  2024-04-15 12:20 ` [PATCH 1/6] [v3] kbuild: turn on -Wextra " Arnd Bergmann
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Arnd Bergmann @ 2024-04-15 12:20 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Arnd Bergmann, Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Kees Cook, linux-kbuild, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Hi Andrew,

All the warning fixes I sent for these warnings have been merged into
mainline or linux-next, so let's turn them on by default.

Since some of the bugfixes are still in flight in maintainer trees,
I have rebased this on top of the mm/mm-nonmm-unstable branch
for the purpose of merging these during the second half of the
6.10 merge window.

I did thorough testing of the changes on x86, arm64 and arm, as
well as allmodconfig testing across all architectures and compilers.
It is still likely that this will catch more warnings that show
up in configurations I did not test, or in newly merged code,
and I plan to send fixes for those as well.

I also sent patches to enable -Wunused-const-variable and
-Wtautological-constant-out-of-range-compare, but those still
need additional bugfixes to get merged first.

Arnd Bergmann (6):
  [v3] kbuild: turn on -Wextra by default
  [v3] kbuild: remove redundant extra warning flags
  [v3] kbuild: turn on -Wrestrict by default
  [v3] kbuild: enable -Wformat-truncation on clang
  [v3] kbuild: enable -Wcast-function-type-strict unconditionally
  [v3] kbuild: enable -Wstringop-truncation globally

 scripts/Makefile.extrawarn | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

-- 
2.39.2

Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Cc: Kees Cook <keescook@chromium.org>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH 3/6] [v3] kbuild: turn on -Wrestrict by default
@ 2024-04-15 16:55 Gatlin Newhouse
  0 siblings, 0 replies; 13+ messages in thread
From: Gatlin Newhouse @ 2024-04-15 16:55 UTC (permalink / raw)
  To: arnd
  Cc: akpm, arnd, Kees Cook, linux-kbuild, linux-kernel, masahiroy,
	Nathan Chancellor, nicolas

> All known -Wrestrict warnings are addressed now, so don't disable the warning
> any more.

I've done some testing of a similar patch with gcc versions 8 to 13 and clang
versions 12 to 15 for x86_64 allmodconfig builds and found no issues building.

Tested-by: Gatlin Newhouse <gatlin.newhouse@gmail.com>

>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  scripts/Makefile.extrawarn | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 8b3f5b62b837..95466a04d51b 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -98,7 +98,6 @@ else
>  # Suppress them by using -Wno... except for W=1.
>  KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
>  KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
> -KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
>  KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
>  KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
>  KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
> --
> 2.39.2
>

--
Gatlin Newhouse

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-05-28 13:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 12:20 [PATCH 0/6] [v3] kbuild: enable more warnings by default Arnd Bergmann
2024-04-15 12:20 ` [PATCH 1/6] [v3] kbuild: turn on -Wextra " Arnd Bergmann
2024-04-15 16:16   ` Kees Cook
2024-04-15 12:20 ` [PATCH 2/6] [v3] kbuild: remove redundant extra warning flags Arnd Bergmann
2024-04-15 12:20 ` [PATCH 3/6] [v3] kbuild: turn on -Wrestrict by default Arnd Bergmann
2024-04-15 16:14   ` Kees Cook
2024-05-28 13:01   ` Geert Uytterhoeven
2024-04-15 12:20 ` [PATCH 4/6] [v3] kbuild: enable -Wformat-truncation on clang Arnd Bergmann
2024-04-15 12:20 ` [PATCH 5/6] [v3] kbuild: enable -Wcast-function-type-strict unconditionally Arnd Bergmann
2024-04-15 16:15   ` Kees Cook
2024-04-15 12:20 ` [PATCH 6/6] [v3] kbuild: enable -Wstringop-truncation globally Arnd Bergmann
2024-04-15 16:15   ` Kees Cook
  -- strict thread matches above, loose matches on Subject: below --
2024-04-15 16:55 [PATCH 3/6] [v3] kbuild: turn on -Wrestrict by default Gatlin Newhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox