scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 07345f7f24d63fed872049435421452e92622483
parent ee71aa8e400604c865f04db89601e2597da26ad5
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  5 Aug 2014 17:52:33 +0200

Allow incomplete types in type names

Type names and declaration uses the same code, and in this moment
the code was generating an error always that we find an incomplete
type, but this code was also executed in something like:

	(struct type *)

Diffstat:
cc1/decl.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cc1/decl.c b/cc1/decl.c @@ -165,7 +165,9 @@ declarator(Type *tp, int8_t flags) break; } } - if (!tp->defined) + + /* TODO: deal with external array declarations of [] */ + if (!tp->defined && *sym->name) error("declared variable '%s' of incomplete type", sym->name); sym->type = tp; return sym;