aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-06-18 18:08:29 -0700
committerMichael Forney <mforney@mforney.org>2019-06-18 18:09:29 -0700
commitb237b938d0e10da65f951ed64e7e38ae5926c804 (patch)
tree7aaa0ed00cc4cadd7631cc4deb9ca1c14acc0fd4
parent02924887cf666e76a97413ddf18b1da997c400b9 (diff)
downloadcproc-b237b938d0e10da65f951ed64e7e38ae5926c804.tar.xz
decl: _Thread_local is not yet supported
-rw-r--r--decl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/decl.c b/decl.c
index 050bf05..11f7c12 100644
--- a/decl.c
+++ b/decl.c
@@ -887,13 +887,18 @@ decl(struct scope *s, struct func *f)
base = declspecs(s, &sc, &fs, &align);
if (!base.type)
return false;
- if (!f) {
+ if (f) {
+ if (sc == SCTHREADLOCAL)
+ error(&tok.loc, "block scope declaration containing '_Thread_local' must contain 'static' or 'extern'");
+ } else {
/* 6.9p2 */
if (sc & SCAUTO)
error(&tok.loc, "external declaration must not contain 'auto'");
if (sc & SCREGISTER)
error(&tok.loc, "external declaration must not contain 'register'");
}
+ if (sc & SCTHREADLOCAL)
+ error(&tok.loc, "'_Thread_local' is not yet supported");
if (consume(TSEMICOLON)) {
/* XXX 6.7p2 error unless in function parameter/struct/union, or tag/enum members are declared */
return true;