[hackers] [scc] Mark auto as invalid storage class for parameters || Roberto E. Vargas Caballero
commit bd3704ba7221b1432934c82a3ec6181849d8ebd8
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Aug 8 17:05:40 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Aug 8 17:05:40 2015 +0200
Mark auto as invalid storage class for parameters
The only valid storage class for a parameter is register.
diff --git a/cc1/decl.c b/cc1/decl.c
index 3ea8de2..227848a 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -69,10 +69,10 @@ parameter(Symbol *sym, int sclass, Type *data)
error("incorrect function type for a function parameter");
if (tp->op == ARY)
tp = mktype(tp->type, PTR, 0, NULL);
+ if (sym->flags & (ISSTATIC|ISEXTERN|ISAUTO))
+ error("bad storage class in function parameter");
if (!sclass)
sym->flags |= ISAUTO;
- if (sym->flags & (ISSTATIC|ISEXTERN))
- error("bad storage class in function parameter");
if (n++ == NR_FUNPARAM)
error("too much parameters in function definition");
funtp->pars = xrealloc(funtp->pars, n * sizeof(Type *));
Received on Sat Aug 08 2015 - 23:02:35 CEST
This archive was generated by hypermail 2.3.0
: Sat Aug 08 2015 - 23:12:10 CEST