Skip to content

Commit 1344794

Browse files
arndbmasahir0y
authored andcommitted
Kbuild: add -Wno-shift-negative-value where -Wextra is used
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 <[email protected]> Acked-by: Jani Nikula <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Tested-by: Sedat Dilek <[email protected]> # LLVM/Clang v13.0.0 (x86-64) Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 754e0b0 commit 1344794

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ subdir-ccflags-y += -Wno-unused-parameter
1717
subdir-ccflags-y += -Wno-type-limits
1818
subdir-ccflags-y += -Wno-missing-field-initializers
1919
subdir-ccflags-y += -Wno-sign-compare
20+
subdir-ccflags-y += -Wno-shift-negative-value
2021
subdir-ccflags-y += $(call cc-disable-warning, unused-but-set-variable)
2122
subdir-ccflags-y += $(call cc-disable-warning, frame-address)
2223
subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror

drivers/staging/greybus/tools/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ CFLAGS += -std=gnu99 -Wall -Wextra -g \
1212
-Wredundant-decls \
1313
-Wcast-align \
1414
-Wsign-compare \
15-
-Wno-missing-field-initializers
15+
-Wno-missing-field-initializers \
16+
-Wno-shift-negative-value
1617

1718
CC := $(CROSS_COMPILE)gcc
1819

fs/btrfs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ subdir-ccflags-y += $(condflags)
1717
subdir-ccflags-y += -Wno-missing-field-initializers
1818
subdir-ccflags-y += -Wno-sign-compare
1919
subdir-ccflags-y += -Wno-type-limits
20+
subdir-ccflags-y += -Wno-shift-negative-value
2021

2122
obj-$(CONFIG_BTRFS_FS) := btrfs.o
2223

scripts/Makefile.extrawarn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
3636
KBUILD_CFLAGS += -Wno-missing-field-initializers
3737
KBUILD_CFLAGS += -Wno-sign-compare
3838
KBUILD_CFLAGS += -Wno-type-limits
39+
KBUILD_CFLAGS += -Wno-shift-negative-value
3940

4041
KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1
4142

0 commit comments

Comments
 (0)