diff options
author | Michael Forney <mforney@mforney.org> | 2019-04-13 19:37:36 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-04-13 19:37:36 -0700 |
commit | 8957f55d531472e8ee742cc1e8d74deba2b6997d (patch) | |
tree | b24fa6437bce4606de83aada2c7a502ed7758239 | |
parent | 5f75e0b752978450bac1fd82b977727bebce52f3 (diff) |
decl: Allow `register` in old-style parameter declarations
-rw-r--r-- | decl.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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) |