* [PATCH 1/2] kconfig: remove unused variable in qconf.cc
@ 2020-02-17 1:27 Masahiro Yamada
2020-02-17 1:27 ` [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS Masahiro Yamada
0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2020-02-17 1:27 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Masahiro Yamada
If this file were compiled with -Wall, the following warning would be
reported:
scripts/kconfig/qconf.cc:312:6: warning: unused variable ‘i’ [-Wunused-variable]
int i;
^
The commit prepares to turn on -Wall for host programs written in C++.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/kconfig/qconf.cc | 2 --
1 file changed, 2 deletions(-)
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 82773cc35d35..50a5245d87bb 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -309,8 +309,6 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
rootEntry(0), headerPopup(0)
{
- int i;
-
setObjectName(name);
setSortingEnabled(false);
setRootIsDecorated(true);
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2020-02-17 1:27 [PATCH 1/2] kconfig: remove unused variable in qconf.cc Masahiro Yamada @ 2020-02-17 1:27 ` Masahiro Yamada 2020-02-19 23:37 ` kbuild test robot 0 siblings, 1 reply; 7+ messages in thread From: Masahiro Yamada @ 2020-02-17 1:27 UTC (permalink / raw) To: linux-kbuild; +Cc: linux-kernel, Masahiro Yamada, Michal Marek Add -Wall to catch more warnings for host programs written in C++. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f15926b83bb..0ad7c1b14d59 100644 --- a/Makefile +++ b/Makefile @@ -399,7 +399,7 @@ HOSTCXX = g++ KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ $(HOSTCFLAGS) -KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) +KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) -- 2.17.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2020-02-17 1:27 ` [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS Masahiro Yamada @ 2020-02-19 23:37 ` kbuild test robot 2020-02-20 2:39 ` Masahiro Yamada 0 siblings, 1 reply; 7+ messages in thread From: kbuild test robot @ 2020-02-19 23:37 UTC (permalink / raw) To: Masahiro Yamada; +Cc: kbuild-all, linux-kbuild, Michal Marek [-- Attachment #1: Type: text/plain, Size: 6124 bytes --] Hi Masahiro, I love your patch! Perhaps something to improve: [auto build test WARNING on kbuild/for-next] [also build test WARNING on kbuild/kconfig linux/master linus/master v5.6-rc2 next-20200219] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Masahiro-Yamada/kconfig-remove-unused-variable-in-qconf-cc/20200219-035229 base: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next config: i386-randconfig-a003-20200219 (attached as .config) compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010 reproduce: # save the attached .config to linux build tree make ARCH=i386 If you fix the issue, kindly add following tag Reported-by: kbuild test robot <lkp@intel.com> All warnings (new ones prefixed by >>): In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:27, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, from scripts//gcc-plugins/gcc-common.h:9, from scripts//gcc-plugins/cyc_complexity_plugin.c:21: >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 102 | fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ | ^ /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 170 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ | ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:48, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, from scripts//gcc-plugins/gcc-common.h:9, from scripts//gcc-plugins/cyc_complexity_plugin.c:21: >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 126 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ | ^ -- In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:27, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, from scripts/gcc-plugins/gcc-common.h:9, from scripts/gcc-plugins/randomize_layout_plugin.c:19: >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 102 | fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ | ^ /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 170 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ | ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:27, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, from scripts/gcc-plugins/gcc-common.h:9, from scripts/gcc-plugins/cyc_complexity_plugin.c:21: >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 102 | fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ | ^ /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 170 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ | ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:48, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, from scripts/gcc-plugins/gcc-common.h:9, from scripts/gcc-plugins/randomize_layout_plugin.c:19: >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 126 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ | ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:48, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, from scripts/gcc-plugins/gcc-common.h:9, from scripts/gcc-plugins/cyc_complexity_plugin.c:21: >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] 126 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ | ^ Cyclomatic Complexity 1 scripts/mod/devicetable-offsets.c:main Cyclomatic Complexity 1 kernel/bounds.c:main Cyclomatic Complexity 1 arch/x86/kernel/asm-offsets_32.c:foo Cyclomatic Complexity 1 arch/x86/kernel/asm-offsets.c:common 51 real 8 user 9 sys 33.65% cpu make prepare --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org [-- Attachment #2: .config.gz --] [-- Type: application/gzip, Size: 32763 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2020-02-19 23:37 ` kbuild test robot @ 2020-02-20 2:39 ` Masahiro Yamada 0 siblings, 0 replies; 7+ messages in thread From: Masahiro Yamada @ 2020-02-20 2:39 UTC (permalink / raw) To: kbuild test robot; +Cc: kbuild-all, Linux Kbuild mailing list, Michal Marek On Thu, Feb 20, 2020 at 8:37 AM kbuild test robot <lkp@intel.com> wrote: > > Hi Masahiro, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on kbuild/for-next] > [also build test WARNING on kbuild/kconfig linux/master linus/master v5.6-rc2 next-20200219] > [if your patch is applied to the wrong git tree, please drop us a note to help > improve the system. BTW, we also suggest to use '--base' option to specify the > base tree in git format-patch, please see https://stackoverflow.com/a/37406982] > > url: https://github.com/0day-ci/linux/commits/Masahiro-Yamada/kconfig-remove-unused-variable-in-qconf-cc/20200219-035229 > base: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git for-next > config: i386-randconfig-a003-20200219 (attached as .config) > compiler: gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010 > reproduce: > # save the attached .config to linux build tree > make ARCH=i386 > > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot <lkp@intel.com> > > All warnings (new ones prefixed by >>): > > In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:27, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, > from scripts//gcc-plugins/gcc-common.h:9, > from scripts//gcc-plugins/cyc_complexity_plugin.c:21: > >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 102 | fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ Thanks for the report. This is a warning from the toolchain headers. I cannot fix it. I do not see this warning on newer GCC. > | ^ > /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 170 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > | ^ > In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:48, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, > from scripts//gcc-plugins/gcc-common.h:9, > from scripts//gcc-plugins/cyc_complexity_plugin.c:21: > >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 126 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > | ^ > -- > In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:27, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, > from scripts/gcc-plugins/gcc-common.h:9, > from scripts/gcc-plugins/randomize_layout_plugin.c:19: > >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 102 | fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ > | ^ > /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 170 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > | ^ > In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:27, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, > from scripts/gcc-plugins/gcc-common.h:9, > from scripts/gcc-plugins/cyc_complexity_plugin.c:21: > >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 102 | fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ > | ^ > /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 170 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > | ^ > In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:48, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, > from scripts/gcc-plugins/gcc-common.h:9, > from scripts/gcc-plugins/randomize_layout_plugin.c:19: > >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 126 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > | ^ > In file included from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/tm.h:48, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/gcc-plugin.h:31, > from /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/plugin.h:23, > from scripts/gcc-plugins/gcc-common.h:9, > from scripts/gcc-plugins/cyc_complexity_plugin.c:21: > >> /usr/lib/gcc/x86_64-linux-gnu/5/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > 126 | fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > | ^ > Cyclomatic Complexity 1 scripts/mod/devicetable-offsets.c:main > Cyclomatic Complexity 1 kernel/bounds.c:main > Cyclomatic Complexity 1 arch/x86/kernel/asm-offsets_32.c:foo > Cyclomatic Complexity 1 arch/x86/kernel/asm-offsets.c:common > 51 real 8 user 9 sys 33.65% cpu make prepare > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] kconfig: remove unused variable in qconf.cc
@ 2020-03-25 3:14 Masahiro Yamada
2020-03-25 3:14 ` [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS Masahiro Yamada
0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2020-03-25 3:14 UTC (permalink / raw)
To: linux-kbuild; +Cc: Kees Cook, kernel-hardening, Masahiro Yamada, linux-kernel
If this file were compiled with -Wall, the following warning would be
reported:
scripts/kconfig/qconf.cc:312:6: warning: unused variable ‘i’ [-Wunused-variable]
int i;
^
The commit prepares to turn on -Wall for C++ host programs.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/kconfig/qconf.cc | 2 --
1 file changed, 2 deletions(-)
diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 82773cc35d35..50a5245d87bb 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -309,8 +309,6 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt),
rootEntry(0), headerPopup(0)
{
- int i;
-
setObjectName(name);
setSortingEnabled(false);
setRootIsDecorated(true);
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2020-03-25 3:14 [PATCH 1/2] kconfig: remove unused variable in qconf.cc Masahiro Yamada @ 2020-03-25 3:14 ` Masahiro Yamada 2020-03-26 2:06 ` Kees Cook 0 siblings, 1 reply; 7+ messages in thread From: Masahiro Yamada @ 2020-03-25 3:14 UTC (permalink / raw) To: linux-kbuild Cc: Kees Cook, kernel-hardening, Masahiro Yamada, Emese Revfy, Michal Marek, linux-kernel Add -Wall to catch more warnings for C++ host programs. When I submitted the previous version, the 0-day bot reported -Wc++11-compat warnings for old GCC: HOSTCXX -fPIC scripts/gcc-plugins/latent_entropy_plugin.o In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:28:0, from scripts/gcc-plugins/gcc-common.h:15, from scripts/gcc-plugins/latent_entropy_plugin.c:78: /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ ^ /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:42:0, from scripts/gcc-plugins/gcc-common.h:15, from scripts/gcc-plugins/latent_entropy_plugin.c:78: /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ ^ The source of the warnings is in the plugin headers, so we have no control of it. I just suppressed them by adding -Wno-c++11-compat to scripts/gcc-plugins/Makefile. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- Makefile | 2 +- scripts/gcc-plugins/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3b57ccab367b..593d8f1bbe90 100644 --- a/Makefile +++ b/Makefile @@ -400,7 +400,7 @@ HOSTCXX = g++ KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ $(HOSTCFLAGS) -KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) +KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile index f2ee8bd7abc6..efff00959a9c 100644 --- a/scripts/gcc-plugins/Makefile +++ b/scripts/gcc-plugins/Makefile @@ -10,7 +10,7 @@ else HOSTLIBS := hostcxxlibs HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb - HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable + HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat export HOST_EXTRACXXFLAGS endif -- 2.17.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2020-03-25 3:14 ` [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS Masahiro Yamada @ 2020-03-26 2:06 ` Kees Cook 2020-03-29 11:04 ` Masahiro Yamada 0 siblings, 1 reply; 7+ messages in thread From: Kees Cook @ 2020-03-26 2:06 UTC (permalink / raw) To: Masahiro Yamada Cc: linux-kbuild, kernel-hardening, Emese Revfy, Michal Marek, linux-kernel On Wed, Mar 25, 2020 at 12:14:32PM +0900, Masahiro Yamada wrote: > Add -Wall to catch more warnings for C++ host programs. > > When I submitted the previous version, the 0-day bot reported > -Wc++11-compat warnings for old GCC: > > HOSTCXX -fPIC scripts/gcc-plugins/latent_entropy_plugin.o > In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:28:0, > from scripts/gcc-plugins/gcc-common.h:15, > from scripts/gcc-plugins/latent_entropy_plugin.c:78: > /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ > ^ > /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > ^ > In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:42:0, > from scripts/gcc-plugins/gcc-common.h:15, > from scripts/gcc-plugins/latent_entropy_plugin.c:78: > /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > ^ > > The source of the warnings is in the plugin headers, so we have no > control of it. I just suppressed them by adding -Wno-c++11-compat to > scripts/gcc-plugins/Makefile. > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Kees Cook <keescook@chromium.org> -Kees > --- > > Makefile | 2 +- > scripts/gcc-plugins/Makefile | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index 3b57ccab367b..593d8f1bbe90 100644 > --- a/Makefile > +++ b/Makefile > @@ -400,7 +400,7 @@ HOSTCXX = g++ > KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \ > -fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \ > $(HOSTCFLAGS) > -KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) > +KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) > KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) > KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS) > > diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile > index f2ee8bd7abc6..efff00959a9c 100644 > --- a/scripts/gcc-plugins/Makefile > +++ b/scripts/gcc-plugins/Makefile > @@ -10,7 +10,7 @@ else > HOSTLIBS := hostcxxlibs > HOST_EXTRACXXFLAGS += -I$(GCC_PLUGINS_DIR)/include -I$(src) -std=gnu++98 -fno-rtti > HOST_EXTRACXXFLAGS += -fno-exceptions -fasynchronous-unwind-tables -ggdb > - HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable > + HOST_EXTRACXXFLAGS += -Wno-narrowing -Wno-unused-variable -Wno-c++11-compat > export HOST_EXTRACXXFLAGS > endif > > -- > 2.17.1 > -- Kees Cook ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS 2020-03-26 2:06 ` Kees Cook @ 2020-03-29 11:04 ` Masahiro Yamada 0 siblings, 0 replies; 7+ messages in thread From: Masahiro Yamada @ 2020-03-29 11:04 UTC (permalink / raw) To: Kees Cook Cc: Linux Kbuild mailing list, Kernel Hardening, Emese Revfy, Michal Marek, Linux Kernel Mailing List On Thu, Mar 26, 2020 at 11:06 AM Kees Cook <keescook@chromium.org> wrote: > > On Wed, Mar 25, 2020 at 12:14:32PM +0900, Masahiro Yamada wrote: > > Add -Wall to catch more warnings for C++ host programs. > > > > When I submitted the previous version, the 0-day bot reported > > -Wc++11-compat warnings for old GCC: > > > > HOSTCXX -fPIC scripts/gcc-plugins/latent_entropy_plugin.o > > In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:28:0, > > from scripts/gcc-plugins/gcc-common.h:15, > > from scripts/gcc-plugins/latent_entropy_plugin.c:78: > > /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:102:21: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > > fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\ > > ^ > > /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/config/elfos.h:170:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > > fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > > ^ > > In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/tm.h:42:0, > > from scripts/gcc-plugins/gcc-common.h:15, > > from scripts/gcc-plugins/latent_entropy_plugin.c:78: > > /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/defaults.h:126:24: warning: C++11 requires a space between string literal and macro [-Wc++11-compat] > > fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \ > > ^ > > > > The source of the warnings is in the plugin headers, so we have no > > control of it. I just suppressed them by adding -Wno-c++11-compat to > > scripts/gcc-plugins/Makefile. > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > Acked-by: Kees Cook <keescook@chromium.org> > > -Kees Applied to linux-kbuild. -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-03-29 11:05 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2020-02-17 1:27 [PATCH 1/2] kconfig: remove unused variable in qconf.cc Masahiro Yamada 2020-02-17 1:27 ` [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS Masahiro Yamada 2020-02-19 23:37 ` kbuild test robot 2020-02-20 2:39 ` Masahiro Yamada -- strict thread matches above, loose matches on Subject: below -- 2020-03-25 3:14 [PATCH 1/2] kconfig: remove unused variable in qconf.cc Masahiro Yamada 2020-03-25 3:14 ` [PATCH 2/2] kbuild: add -Wall to KBUILD_HOSTCXXFLAGS Masahiro Yamada 2020-03-26 2:06 ` Kees Cook 2020-03-29 11:04 ` Masahiro Yamada
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).