scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

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:
Mcc1/types.c | 4++++
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;