From 24bed78dfb87e0240d23647342f5c392e9da0722 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 24 Jun 2016 17:59:15 +0100 Subject: [PATCH] sym.c: allow for void functions but not variables --- Applications/SmallC/sym.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.34.1