[PATCH 3/4] powerpc: Add -Wvla to arch CFLAGS

Kees Cook keescook at chromium.org
Thu Oct 11 01:45:49 AEDT 2018


On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe at ellerman.id.au> wrote:
> Upstream has declared that Variable Length Array's (VLAs) are a bad
> idea, and eventually -Wvla will be added to the top-level Makefile. We
> can go one better and make sure we don't introduce any more by adding
> it to the arch Makefile.
>
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> ---
>  arch/powerpc/Kbuild | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild
> index 1625a06802ca..86b261d6bde5 100644
> --- a/arch/powerpc/Kbuild
> +++ b/arch/powerpc/Kbuild
> @@ -1,4 +1,5 @@
> -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
> +subdir-ccflags-y := $(call cc-option, -Wvla)
> +subdir-ccflags-$(CONFIG_PPC_WERROR) += -Werror
>
>  obj-y += kernel/
>  obj-y += mm/

-Wvla will be going into the top-level Makefile in the merge window
(see linux-next), so this will be redundant.

-Kees

-- 
Kees Cook
Pixel Security


More information about the Linuxppc-dev mailing list