Re: [PATCH 2/2] kconfig: Improve ergonomics around disabling warnings with cc-option
From: Kees Cook
Date: Fri Oct 09 2026 - 02:55:21 EST
On Wed, Oct 07, 2026 at 05:22:22PM +0200, Nathan Chancellor wrote:
> This is essentially a port of commit 550ccb178de2 ("Make 'cc-option'
> work correctly for the -Wno-xyzzy pattern") to scripts/Kconfig.include,
> which simplifies the definition of many of the newly added CC_OPT_WNO_
> symbols in scripts/Kconfig.toolchain and matches cc-option's behavior in
> Kbuild.
>
> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> ---
> scripts/Kconfig.include | 2 +-
> scripts/Kconfig.toolchain | 18 +++++++++---------
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
> index 622d21e6953f..a7d9201acfcc 100644
> --- a/scripts/Kconfig.include
> +++ b/scripts/Kconfig.include
> @@ -26,7 +26,7 @@ failure = $(if-success,$(1),n,y)
> # $(cc-probe,<flag>)
> # The command $(cc-option) and $(cc-option-str) test <flag> with. Not meant
> # to be called directly; use one of those two instead.
> -cc-probe = trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o
> +cc-probe = trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(shell,echo $(1) | sed "s;^-Wno-;-W;") -c -x c /dev/null -o .tmp_$$/tmp.o
Nice! Yeah, good cleanup.
Reviewed-by: Kees Cook <kees@xxxxxxxxxx>
--
Kees Cook