LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] kbuild: add -Wvla flag unconditionally
@ 2019-05-09  6:45 Masahiro Yamada
  2019-05-09  7:07 ` Sedat Dilek
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-05-09  6:45 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Nick Desaulniers, Nathan Chancellor, Arnd Bergmann,
	clang-built-linux, Masahiro Yamada, Michal Marek, linux-kernel

This flag is documented in the GCC 4.6 manual, and recognized by
Clang as well. Let's rip off the cc-option switch.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c71ffb6f55b5..3f5e8a0f4561 100644
--- a/Makefile
+++ b/Makefile
@@ -841,7 +841,7 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
 KBUILD_CFLAGS += -Wdeclaration-after-statement
 
 # Variable Length Arrays (VLAs) should not be used anywhere in the kernel
-KBUILD_CFLAGS += $(call cc-option,-Wvla)
+KBUILD_CFLAGS += -Wvla
 
 # disable pointer signed / unsigned warnings in gcc 4.0
 KBUILD_CFLAGS += -Wno-pointer-sign
-- 
2.17.1


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

* Re: [PATCH] kbuild: add -Wvla flag unconditionally
  2019-05-09  6:45 [PATCH] kbuild: add -Wvla flag unconditionally Masahiro Yamada
@ 2019-05-09  7:07 ` Sedat Dilek
  2019-05-09 11:16 ` Nathan Chancellor
  2019-05-09 16:11 ` Kees Cook
  2 siblings, 0 replies; 6+ messages in thread
From: Sedat Dilek @ 2019-05-09  7:07 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Nick Desaulniers, Nathan Chancellor, Arnd Bergmann,
	Clang-Built-Linux ML, Michal Marek, linux-kernel, Kees Cook

On Thu, May 9, 2019 at 8:46 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> This flag is documented in the GCC 4.6 manual, and recognized by
> Clang as well. Let's rip off the cc-option switch.
>

[ CC Kees who did the VLA removal/cleanup ]

Looks good to me.

Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index c71ffb6f55b5..3f5e8a0f4561 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -841,7 +841,7 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
>  KBUILD_CFLAGS += -Wdeclaration-after-statement
>
>  # Variable Length Arrays (VLAs) should not be used anywhere in the kernel
> -KBUILD_CFLAGS += $(call cc-option,-Wvla)
> +KBUILD_CFLAGS += -Wvla
>
>  # disable pointer signed / unsigned warnings in gcc 4.0
>  KBUILD_CFLAGS += -Wno-pointer-sign
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com.
> To post to this group, send email to clang-built-linux@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20190509064549.1302-1-yamada.masahiro%40socionext.com.
> For more options, visit https://groups.google.com/d/optout.

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

* Re: [PATCH] kbuild: add -Wvla flag unconditionally
  2019-05-09  6:45 [PATCH] kbuild: add -Wvla flag unconditionally Masahiro Yamada
  2019-05-09  7:07 ` Sedat Dilek
@ 2019-05-09 11:16 ` Nathan Chancellor
  2019-05-09 16:11 ` Kees Cook
  2 siblings, 0 replies; 6+ messages in thread
From: Nathan Chancellor @ 2019-05-09 11:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Nick Desaulniers, Arnd Bergmann, clang-built-linux,
	Michal Marek, linux-kernel

On Thu, May 09, 2019 at 03:45:49PM +0900, Masahiro Yamada wrote:
> This flag is documented in the GCC 4.6 manual, and recognized by
> Clang as well. Let's rip off the cc-option switch.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

> ---
> 
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index c71ffb6f55b5..3f5e8a0f4561 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -841,7 +841,7 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
>  KBUILD_CFLAGS += -Wdeclaration-after-statement
>  
>  # Variable Length Arrays (VLAs) should not be used anywhere in the kernel
> -KBUILD_CFLAGS += $(call cc-option,-Wvla)
> +KBUILD_CFLAGS += -Wvla
>  
>  # disable pointer signed / unsigned warnings in gcc 4.0
>  KBUILD_CFLAGS += -Wno-pointer-sign
> -- 
> 2.17.1
> 

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

* Re: [PATCH] kbuild: add -Wvla flag unconditionally
  2019-05-09  6:45 [PATCH] kbuild: add -Wvla flag unconditionally Masahiro Yamada
  2019-05-09  7:07 ` Sedat Dilek
  2019-05-09 11:16 ` Nathan Chancellor
@ 2019-05-09 16:11 ` Kees Cook
  2019-05-09 16:51   ` Nick Desaulniers
  2 siblings, 1 reply; 6+ messages in thread
From: Kees Cook @ 2019-05-09 16:11 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, Nick Desaulniers, Nathan Chancellor, Arnd Bergmann,
	clang-built-linux, Michal Marek, LKML

On Wed, May 8, 2019 at 11:46 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> This flag is documented in the GCC 4.6 manual, and recognized by
> Clang as well. Let's rip off the cc-option switch.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

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

-- 
Kees Cook

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

* Re: [PATCH] kbuild: add -Wvla flag unconditionally
  2019-05-09 16:11 ` Kees Cook
@ 2019-05-09 16:51   ` Nick Desaulniers
  2019-05-13  2:23     ` Masahiro Yamada
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Desaulniers @ 2019-05-09 16:51 UTC (permalink / raw)
  To: Kees Cook
  Cc: Masahiro Yamada, linux-kbuild, Nathan Chancellor, Arnd Bergmann,
	clang-built-linux, Michal Marek, LKML

> On Wed, May 8, 2019 at 11:46 PM Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> > This flag is documented in the GCC 4.6 manual, and recognized by
> > Clang as well. Let's rip off the cc-option switch.

Checked w/ godbolt w/ Clang 4 and GCC 4.6.4.
Tested-by: Nick Desaulniers <ndesaulniers@google.com>

-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] kbuild: add -Wvla flag unconditionally
  2019-05-09 16:51   ` Nick Desaulniers
@ 2019-05-13  2:23     ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2019-05-13  2:23 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Kees Cook, linux-kbuild, Nathan Chancellor, Arnd Bergmann,
	clang-built-linux, Michal Marek, LKML

On Fri, May 10, 2019 at 1:52 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> > On Wed, May 8, 2019 at 11:46 PM Masahiro Yamada
> > <yamada.masahiro@socionext.com> wrote:
> > > This flag is documented in the GCC 4.6 manual, and recognized by
> > > Clang as well. Let's rip off the cc-option switch.
>
> Checked w/ godbolt w/ Clang 4 and GCC 4.6.4.
> Tested-by: Nick Desaulniers <ndesaulniers@google.com>
>
> --
> Thanks,
> ~Nick Desaulniers

Applied to linux-kbuild.


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-05-13  2:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09  6:45 [PATCH] kbuild: add -Wvla flag unconditionally Masahiro Yamada
2019-05-09  7:07 ` Sedat Dilek
2019-05-09 11:16 ` Nathan Chancellor
2019-05-09 16:11 ` Kees Cook
2019-05-09 16:51   ` Nick Desaulniers
2019-05-13  2:23     ` 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).