From: Alan Cox Date: Fri, 24 Jun 2016 16:59:15 +0000 (+0100) Subject: sym.c: allow for void functions but not variables X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=24bed78dfb87e0240d23647342f5c392e9da0722;p=FUZIX.git sym.c: allow for void functions but not variables --- diff --git a/Applications/SmallC/sym.c b/Applications/SmallC/sym.c index 769b04eb..bafbc790 100644 --- a/Applications/SmallC/sym.c +++ b/Applications/SmallC/sym.c @@ -35,10 +35,14 @@ int declare_global(int type, int storage, TAG_SYMBOL *mtag, int otag, int is_str multidef (sname); if (match ("(")) { /* FIXME: We need to deal with pointer types properly here */ + if (identity == POINTER) + type = CINT; newfunc_typed(storage, sname, type); /* Can't int foo(x){blah),a=4; */ return 1; } + if (identity == VARIABLE && type == VOID) + error("cannot have void variables"); if (match ("[")) { dim = needsub (); //if (dim || storage == EXTERN) {