diff options
author | Michael Forney <mforney@mforney.org> | 2021-07-01 01:33:25 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-07-01 01:39:40 -0700 |
commit | b2dc1102c3ae0976e9435f80df660b821742a2c8 (patch) | |
tree | f98346de4a27f007147e8d4deb7db7d82828a4cf /decl.c | |
parent | bb682b0414d1f701610362ea3aaed89c6d43bda1 (diff) |
decl: Check that struct/union has at least one member
Diffstat (limited to 'decl.c')
-rw-r--r-- | decl.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -206,6 +206,8 @@ tagspec(struct scope *s) b.bits = 0; do structdecl(s, &b); while (tok.kind != TRBRACE); + if (!t->structunion.members) + error(&tok.loc, "struct/union has no members"); next(); t->size = ALIGNUP(t->size, t->align); t->incomplete = false; |