diff mbox series

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

Message ID 20181010051308.25422-3-mpe@ellerman.id.au (mailing list archive)
State Rejected
Headers show
Series [1/4] powerpc: Move core kernel logic into arch/powerpc/Kbuild | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch success Test checkpatch on branch next

Commit Message

Michael Ellerman Oct. 10, 2018, 5:13 a.m. UTC
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@ellerman.id.au>
---
 arch/powerpc/Kbuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kees Cook Oct. 10, 2018, 2:45 p.m. UTC | #1
On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@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@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
Michael Ellerman Oct. 11, 2018, 12:30 a.m. UTC | #2
Kees Cook <keescook@chromium.org> writes:
> On Tue, Oct 9, 2018 at 10:13 PM, Michael Ellerman <mpe@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@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.

Thanks, yeah I saw that after I posted. Will drop this one.

cheers
diff mbox series

Patch

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/