Variable length arrays result in excess stack utilisation, with a risk
of stack overflow if the length is too large.  It also results in fairly
poor asm generation, because of requiring a divide as part of the space
calcuation.

Xen no longer has any variable length arrays, so take the opportunity to
formally disallow them.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
CC: George Dunlap <george.dun...@eu.citrix.com>
CC: Jan Beulich <jbeul...@suse.com>
CC: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
CC: Stefano Stabellini <sstabell...@kernel.org>
CC: Tim Deegan <t...@xen.org>
CC: Wei Liu <wei.l...@citrix.com>
CC: Julien Grall <julien.gr...@arm.com>
---
 xen/Rules.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index ac0a8ea..bd11e26 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -58,6 +58,7 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS-$(CONFIG_DEBUG_INFO) += -g
 CFLAGS += '-D__OBJECT_FILE__="$@"'
+$(call cc-option-add,CFLAGS,CC,-Wvla)
 
 ifneq ($(clang),y)
 # Clang doesn't understand this command line argument, and doesn't appear to
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to