]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/i915: Warn against variable length arrays
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 13 Mar 2018 00:40:55 +0000 (00:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 13 Mar 2018 09:43:50 +0000 (09:43 +0000)
VLA are strongly discouraged in the kernel due to ambiguity they impose
on the limited stack space and security concerns over manipulating the
stack frame. Add -Wvla to our compiler flags so that CI rejects them.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180313004055.25411-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/Makefile

index 4eee91a3a236df6e2c8d3f9e42c3d7dbd0fe02f4..fcb8a7b27ae2ffa75464e2327cc3c10a398bb361 100644 (file)
@@ -12,7 +12,7 @@
 # Note the danger in using -Wall -Wextra is that when CI updates gcc we
 # will most likely get a sudden build breakage... Hopefully we will fix
 # new warnings before CI updates!
-subdir-ccflags-y := -Wall -Wextra
+subdir-ccflags-y := -Wall -Wextra -Wvla
 subdir-ccflags-y += $(call cc-disable-warning, unused-parameter)
 subdir-ccflags-y += $(call cc-disable-warning, type-limits)
 subdir-ccflags-y += $(call cc-disable-warning, missing-field-initializers)