diff options
| author | 2022-08-06 16:00:30 +0200 | |
|---|---|---|
| committer | 2022-08-06 16:00:30 +0200 | |
| commit | c53e17496d97a2fb638544cee414de97d81770fc (patch) | |
| tree | 50057b6755d18b15c48b6692337ad1d6c745d78a /bootstrap | |
| parent | f9840532ed954b1bafb600b9c9b1e9b597bb7fef (diff) | |
decl span fix
Diffstat (limited to 'bootstrap')
| -rw-r--r-- | bootstrap/cgen.c | 4 | ||||
| -rw-r--r-- | bootstrap/parse.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c index 3df1ce7..9fa954c 100644 --- a/bootstrap/cgen.c +++ b/bootstrap/cgen.c @@ -601,8 +601,8 @@ defctype(const struct type *ty, void *_) { pri("%t %s;\n", fld.ty, fld.name); } pri("};\n"); - pri("_Static_assert(sizeof(%s) == %U);\n", *cname, (long long)ty->size); - pri("_Static_assert(__alignof__(%s) == %U);\n", *cname, (long long)ty->align); + pri("_Static_assert(sizeof(%s) == %U);\n", *cname, (u64)ty->size); + pri("_Static_assert(__alignof__(%s) == %U);\n", *cname, (u64)ty->align); } break; case TYeunion: diff --git a/bootstrap/parse.c b/bootstrap/parse.c index 025e061..9ab1b53 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -1520,6 +1520,7 @@ parsevardecl(decl_yielder_t yield, void *yarg, struct parser *P) { assert(ty); decl.name = name; + decl.span = tok.span; decl.var.ty = ty; decl.var.ini = ini; decl.var.id = id++; @@ -1547,6 +1548,7 @@ letstmtyield(struct decl *decl, void *arg) { decl->t = Dlet; putdecl(a->P, decl->span, decl); st.decl = *decl; + st.span = decl->span; a->yield(&st, a->stmt_yarg); } @@ -2389,7 +2391,6 @@ parsedecl(decl_yielder_t yield, void *yarg, struct parser *P, bool toplevel) { tok2str(tok)); } - decl.span = tok.span; decl = *putdecl(P, tok.span, &decl); noput: if (yield) |