public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd3b70b
)
sym.c: allow for void functions but not variables
author
Alan Cox
<alan@linux.intel.com>
Fri, 24 Jun 2016 16:59:15 +0000
(17:59 +0100)
committer
Alan Cox
<alan@linux.intel.com>
Fri, 24 Jun 2016 16:59:15 +0000
(17:59 +0100)
Applications/SmallC/sym.c
patch
|
blob
|
history
diff --git
a/Applications/SmallC/sym.c
b/Applications/SmallC/sym.c
index
769b04e
..
bafbc79
100644
(file)
--- 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) {