Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: WangYuli <wangyuli@uniontech.com>
Cc: masahiroy@kernel.org, nicolas.schier@linux.dev,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhanjun@uniontech.com, niecheng1@uniontech.com,
	guanwentao@uniontech.com
Subject: Re: [PATCH] extrawarn: Use cc-disable-warning for shift-negative-value
Date: Thu, 8 May 2025 17:31:38 +0100	[thread overview]
Message-ID: <20250508163138.GA834338@ax162> (raw)
In-Reply-To: <70AA6123A55FEA70+20250507054705.1196184-1-wangyuli@uniontech.com>

On Wed, May 07, 2025 at 01:47:05PM +0800, WangYuli wrote:
> The -Wno-shift-negative-value option is not supported by GCC 5.4.0.

The patch is fine (albeit slightly incomplete because other places add
this unconditionally) but this is not going to matter soon because the
minimum version of GCC is being bumped to 8.1:

https://git.kernel.org/next/linux-next/c/118c40b7b50340bf7ff7e0adee8e3bab6e552c82

Even though we claim to support GCC 5, I suspect that basically nobody
uses it in practice since this flag was added by 1344794a59db2.

> This could potentially result in extra warnings under certain
> circumstances.
> 
> Utilize cc-disable-warning to prevent the following from occurring:
>   mm/vmscan.c: At top level:
>   cc1: error: unrecognized command line option ‘-Wno-shift-negative-value’ [-Werror]
>   cc1: all warnings being treated as errors
> 
> Link: https://lore.kernel.org/all/62726950F697595A+20250507040827.1147510-1-wangyuli@uniontech.com/
> Signed-off-by: WangYuli <wangyuli@uniontech.com>
> ---
>  scripts/Makefile.extrawarn | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index d88acdf40855..375475e7b3bd 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -158,7 +158,7 @@ else
>  # The following turn off the warnings enabled by -Wextra
>  KBUILD_CFLAGS += -Wno-missing-field-initializers
>  KBUILD_CFLAGS += -Wno-type-limits
> -KBUILD_CFLAGS += -Wno-shift-negative-value
> +KBUILD_CFLAGS += $(call cc-disable-warning, shift-negative-value)
>  
>  ifdef CONFIG_CC_IS_CLANG
>  KBUILD_CFLAGS += -Wno-enum-enum-conversion
> -- 
> 2.49.0
> 

      reply	other threads:[~2025-05-08 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07  5:47 [PATCH] extrawarn: Use cc-disable-warning for shift-negative-value WangYuli
2025-05-08 16:31 ` Nathan Chancellor [this message]

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=20250508163138.GA834338@ax162 \
    --to=nathan@kernel.org \
    --cc=guanwentao@uniontech.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nicolas.schier@linux.dev \
    --cc=niecheng1@uniontech.com \
    --cc=wangyuli@uniontech.com \
    --cc=zhanjun@uniontech.com \
    /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