All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Arnd Bergmann <arnd@kernel.org>, Masahiro Yamada <masahiroy@kernel.org>
Cc: alexs@kernel.org, arnd@arndb.de, arnd@kernel.org,
	dsterba@suse.com, elver@google.com, linux-doc@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev, mark.rutland@arm.com,
	ndesaulniers@google.com, ojeda@kernel.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH 1/4] [v4] Kbuild: add -Wno-shift-negative-value where -Wextra is used
Date: Wed, 09 Mar 2022 10:19:25 +0200	[thread overview]
Message-ID: <87ee3b1qsy.fsf@intel.com> (raw)
In-Reply-To: <20220308215615.14183-2-arnd@kernel.org>

On Tue, 08 Mar 2022, Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> As a preparation for moving to -std=gnu11, turn off the
> -Wshift-negative-value option. This warning is enabled by gcc when
> building with -Wextra for c99 or higher, but not for c89. Since
> the kernel already relies on well-defined overflow behavior,
> the warning is not helpful and can simply be disabled in
> all locations that use -Wextra.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Jani Nikula <jani.nikula@intel.com>

> ---
> [v4]
>   split into a separate patch
> ---
>  drivers/gpu/drm/i915/Makefile          | 1 +
>  drivers/staging/greybus/tools/Makefile | 3 ++-
>  fs/btrfs/Makefile                      | 1 +
>  scripts/Makefile.extrawarn             | 1 +
>  4 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index 1b62b9f65196..1618a6e0af4e 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -17,6 +17,7 @@ subdir-ccflags-y += -Wno-unused-parameter
>  subdir-ccflags-y += -Wno-type-limits
>  subdir-ccflags-y += -Wno-missing-field-initializers
>  subdir-ccflags-y += -Wno-sign-compare
> +subdir-ccflags-y += -Wno-shift-negative-value
>  subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
>  subdir-ccflags-y += $(call cc-disable-warning, frame-address)
>  subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
> diff --git a/drivers/staging/greybus/tools/Makefile b/drivers/staging/greybus/tools/Makefile
> index ad0ae8053b79..a3bbd73171f2 100644
> --- a/drivers/staging/greybus/tools/Makefile
> +++ b/drivers/staging/greybus/tools/Makefile
> @@ -12,7 +12,8 @@ CFLAGS	+= -std=gnu99 -Wall -Wextra -g \
>  	    -Wredundant-decls \
>  	    -Wcast-align \
>  	    -Wsign-compare \
> -	    -Wno-missing-field-initializers
> +	    -Wno-missing-field-initializers \
> +	    -Wno-shift-negative-value
>  
>  CC	:= $(CROSS_COMPILE)gcc
>  
> diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
> index 4188ba3fd8c3..99f9995670ea 100644
> --- a/fs/btrfs/Makefile
> +++ b/fs/btrfs/Makefile
> @@ -17,6 +17,7 @@ subdir-ccflags-y += $(condflags)
>  subdir-ccflags-y += -Wno-missing-field-initializers
>  subdir-ccflags-y += -Wno-sign-compare
>  subdir-ccflags-y += -Wno-type-limits
> +subdir-ccflags-y += -Wno-shift-negative-value
>  
>  obj-$(CONFIG_BTRFS_FS) := btrfs.o
>  
> diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
> index 8be892887d71..650d0b8ceec3 100644
> --- a/scripts/Makefile.extrawarn
> +++ b/scripts/Makefile.extrawarn
> @@ -36,6 +36,7 @@ KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
>  KBUILD_CFLAGS += -Wno-missing-field-initializers
>  KBUILD_CFLAGS += -Wno-sign-compare
>  KBUILD_CFLAGS += -Wno-type-limits
> +KBUILD_CFLAGS += -Wno-shift-negative-value
>  
>  KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-03-09  8:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08 21:56 [PATCH 0/4] [v4] Kbuild: std=gnu11 changes Arnd Bergmann
2022-03-08 21:56 ` [PATCH 1/4] [v4] Kbuild: add -Wno-shift-negative-value where -Wextra is used Arnd Bergmann
2022-03-09  8:19   ` Jani Nikula [this message]
2022-03-09 16:47   ` David Sterba
2022-03-08 21:56 ` [PATCH 2/4] [v4] Kbuild: use -Wdeclaration-after-statement Arnd Bergmann
2022-03-08 21:56 ` [PATCH 3/4] [v4] Kbuild: move to -std=gnu11 Arnd Bergmann
2022-03-08 21:56 ` [PATCH 4/4] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS Arnd Bergmann
2022-03-09  0:09 ` [PATCH 0/4] [v4] Kbuild: std=gnu11 changes Linus Torvalds
2022-03-09  2:16   ` Masahiro Yamada
2022-03-09  9:18     ` Masahiro Yamada
2022-03-10  0:06       ` Nathan Chancellor
2022-03-11  1:00         ` Sedat Dilek

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=87ee3b1qsy.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=alexs@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=dsterba@suse.com \
    --cc=elver@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.