From: Andrew Cooper Date: Mon, 17 Sep 2018 14:49:14 +0000 (+0100) Subject: xen: Disallow variable length arrays X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0ace362c8a8854b2256631d4edebb61d4238ddc3;p=people%2Fdariof%2Fxen.git xen: Disallow variable length arrays 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 Acked-by: Wei Liu Acked-by: Julien Grall Acked-by: Jan Beulich --- diff --git a/xen/Rules.mk b/xen/Rules.mk index ac0a8ea2e9..9c697dc57b 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -55,6 +55,7 @@ endif CFLAGS += -nostdinc -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith +$(call cc-option-add,CFLAGS,CC,-Wvla) CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS-$(CONFIG_DEBUG_INFO) += -g CFLAGS += '-D__OBJECT_FILE__="$@"'