kernel: bump 4.14 to 4.14.86
[openwrt/staging/mkresin.git] / target / linux / generic / backport-4.9 / 014-Kbuild-suppress-packed-not-aligned-warning-for-defau.patch
1 From: Xiongfeng Wang <xiongfeng.wang@linaro.org>
2 Date: Thu, 11 Jan 2018 17:22:29 +0800
3 Subject: [PATCH] Kbuild: suppress packed-not-aligned warning for default
4 setting only
5
6 gcc-8 reports many -Wpacked-not-aligned warnings. The below are some
7 examples.
8
9 ./include/linux/ceph/msgr.h:67:1: warning: alignment 1 of 'struct
10 ceph_entity_addr' is less than 8 [-Wpacked-not-aligned]
11 } __attribute__ ((packed));
12
13 ./include/linux/ceph/msgr.h:67:1: warning: alignment 1 of 'struct
14 ceph_entity_addr' is less than 8 [-Wpacked-not-aligned]
15 } __attribute__ ((packed));
16
17 ./include/linux/ceph/msgr.h:67:1: warning: alignment 1 of 'struct
18 ceph_entity_addr' is less than 8 [-Wpacked-not-aligned]
19 } __attribute__ ((packed));
20
21 This patch suppresses this kind of warnings for default setting.
22
23 Signed-off-by: Xiongfeng Wang <xiongfeng.wang@linaro.org>
24 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
25 ---
26
27 --- a/scripts/Makefile.extrawarn
28 +++ b/scripts/Makefile.extrawarn
29 @@ -10,6 +10,8 @@
30 # are not supported by all versions of the compiler
31 # ==========================================================================
32
33 +KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
34 +
35 ifeq ("$(origin W)", "command line")
36 export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
37 endif
38 @@ -25,6 +27,7 @@ warning-1 += -Wold-style-definition
39 warning-1 += $(call cc-option, -Wmissing-include-dirs)
40 warning-1 += $(call cc-option, -Wunused-but-set-variable)
41 warning-1 += $(call cc-option, -Wunused-const-variable)
42 +warning-1 += $(call cc-option, -Wpacked-not-aligned)
43 warning-1 += $(call cc-disable-warning, missing-field-initializers)
44 warning-1 += $(call cc-disable-warning, sign-compare)
45