diff mbox series

[14/14] kbuild: Stop using '-Qunused-arguments' with clang

Message ID 20221228-drop-qunused-arguments-v1-14-658cbc8fc592@kernel.org (mailing list archive)
State New, archived
Headers show
Series Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS | expand

Commit Message

Nathan Chancellor Jan. 4, 2023, 7:54 p.m. UTC
This option masks all unused command line argument warnings, which can
hide potential issues, such as an architecture Makefile adding an
unsupported flag to KBUILD_AFLAGS or KBUILD_CFLAGS, which will cause all
as-option and cc-options to silently fail due to -Werror with no
indication as to why in the main kernel build.

Remove this flag so that warnings of this nature can be caught early and
obviously in a build.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 Makefile | 1 -
 1 file changed, 1 deletion(-)

Comments

Nick Desaulniers Jan. 9, 2023, 10:17 p.m. UTC | #1
On Wed, Jan 4, 2023 at 11:55 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> This option masks all unused command line argument warnings, which can
> hide potential issues, such as an architecture Makefile adding an
> unsupported flag to KBUILD_AFLAGS or KBUILD_CFLAGS, which will cause all
> as-option and cc-options to silently fail due to -Werror with no
> indication as to why in the main kernel build.
>
> Remove this flag so that warnings of this nature can be caught early and
> obviously in a build.
>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Nice job on the series!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  Makefile | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index c05b4fb7121e..4bc79d2a42f2 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -878,7 +878,6 @@ KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings
>  KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y)
>
>  ifdef CONFIG_CC_IS_CLANG
> -KBUILD_CPPFLAGS += -Qunused-arguments
>  # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable.
>  KBUILD_CFLAGS += -Wno-gnu
>  else
>
> --
> 2.39.0
>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index c05b4fb7121e..4bc79d2a42f2 100644
--- a/Makefile
+++ b/Makefile
@@ -878,7 +878,6 @@  KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings
 KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y)
 
 ifdef CONFIG_CC_IS_CLANG
-KBUILD_CPPFLAGS += -Qunused-arguments
 # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable.
 KBUILD_CFLAGS += -Wno-gnu
 else