diff options
author | Michael Forney <mforney@mforney.org> | 2021-10-28 00:49:24 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-12-06 13:51:58 -0800 |
commit | 98719581d6b7c796c3c66bd1d103634e6e2c6eb5 (patch) | |
tree | 83d6ded73eb752029f6767cf5f3d83c636de6c2a | |
parent | 28961f9197c8c5356f29fffac0cc322788441759 (diff) |
decl: Remove struct member name from error messages
It could be NULL in some cases.
-rw-r--r-- | decl.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -668,16 +668,16 @@ addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, un size_t end; if (t->flexible) - error(&tok.loc, "struct member '%s' is after flexible array member", name); + error(&tok.loc, "struct has member after flexible array member"); if (mt.type->incomplete) { if (mt.type->kind != TYPEARRAY) - error(&tok.loc, "struct member '%s' has incomplete type", name); + error(&tok.loc, "struct member has incomplete type"); t->flexible = true; } if (mt.type->kind == TYPEFUNC) - error(&tok.loc, "struct member '%s' has function type", name); + error(&tok.loc, "struct member has function type"); if (mt.type->flexible) - error(&tok.loc, "struct member '%s' contains flexible array member", name); + error(&tok.loc, "struct member contains flexible array member"); assert(mt.type->align > 0); if (name || width == -1) { m = xmalloc(sizeof(*m)); @@ -695,7 +695,7 @@ addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, un m->bits.after = 0; if (align < mt.type->align) { if (align) - error(&tok.loc, "specified alignment of struct member '%s' is less strict than is required by type", name); + error(&tok.loc, "specified alignment of struct member is less strict than is required by type"); align = mt.type->align; } t->size = ALIGNUP(t->size, align); |