linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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; 5+ 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] 5+ 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
  0 siblings, 0 replies; 5+ 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] 5+ messages in thread

* Re: [PATCH 1/2] kconfig: remove unused variable in qconf.cc
  2020-03-26  2:05 ` Kees Cook
@ 2020-03-29 11:03   ` Masahiro Yamada
  0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-03-29 11:03 UTC (permalink / raw)
  To: Kees Cook
  Cc: Linux Kbuild mailing list, Kernel Hardening, 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:31PM +0900, Masahiro Yamada wrote:
> > 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>
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>

Applied to linux-kbuild.



> -Kees
>
> > ---
> >
> >  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
> >
>
> --
> Kees Cook



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] kconfig: remove unused variable in qconf.cc
  2020-03-25  3:14 [PATCH 1/2] kconfig: remove unused variable in qconf.cc Masahiro Yamada
@ 2020-03-26  2:05 ` Kees Cook
  2020-03-29 11:03   ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2020-03-26  2:05 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: linux-kbuild, kernel-hardening, linux-kernel

On Wed, Mar 25, 2020 at 12:14:31PM +0900, Masahiro Yamada wrote:
> 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>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
> 
>  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
> 

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] kconfig: remove unused variable in qconf.cc
@ 2020-03-25  3:14 Masahiro Yamada
  2020-03-26  2:05 ` Kees Cook
  0 siblings, 1 reply; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2020-03-29 11:04 UTC | newest]

Thread overview: 5+ 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-03-25  3:14 [PATCH 1/2] kconfig: remove unused variable in qconf.cc Masahiro Yamada
2020-03-26  2:05 ` Kees Cook
2020-03-29 11:03   ` 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).