commit 82d4a96ab4740538492214657f82a75e43fa2014
parent 81cb385b648a5ae302c8a9f186714bd3d058f6e0
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 25 Aug 2017 15:09:53 +0100
[cc1] Forbid array of voids
It is impossible to have an array of voids, because it is impossible
to declare a variable of type void.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/cc1/types.c b/cc1/types.c
@@ -298,6 +298,10 @@ mktype(Type *tp, int op, TINT nelem, Type *pars[])
switch (op) {
case ARY:
+ if (tp == voidtype) {
+ errorp("declaration of symbol as array of voids");
+ tp = inttype;
+ }
type.letter = L_ARRAY;
if (nelem != 0)
type.prop |= TDEFINED;