[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 5/5] 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 <andrew.cooper3@xxxxxxxxxx>
---
CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Tim Deegan <tim@xxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.