From 8957f55d531472e8ee742cc1e8d74deba2b6997d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 13 Apr 2019 19:37:36 -0700 Subject: decl: Allow `register` in old-style parameter declarations --- decl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/decl.c b/decl.c index d6514a9..d56b2cb 100644 --- a/decl.c +++ b/decl.c @@ -609,11 +609,14 @@ paramdecl(struct scope *s, struct param *params) { struct param *p; struct qualtype t, base; + enum storageclass sc; char *name; - base = declspecs(s, NULL, NULL, NULL); + base = declspecs(s, &sc, NULL, NULL); if (!base.type) return false; + if (sc && sc != SCREGISTER) + error(&tok.loc, "parameter declaration has invalid storage-class specifier"); for (;;) { t = declarator(s, base, &name, false); for (p = params; p && strcmp(name, p->name) != 0; p = p->next) -- cgit v1.2.3