cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 79a8df42a334dab965fa32b6bf4230829dde0d0f
parent 67c96568772bc0686e9a73e1d6490d9d982b53dd
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 24 Apr 2019 20:01:07 -0700

Disallow struct members with function type

Diffstat:
Mdecl.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/decl.c b/decl.c @@ -651,6 +651,9 @@ addmember(struct structbuilder *b, struct qualtype mt, char *name, int align, ui struct member *m; size_t end; + // XXX: check incomplete type, except for flexible array member + if (mt.type->kind == TYPEFUNC) + error(&tok.loc, "struct member '%s' has function type", name); assert(mt.type->align > 0); if (name || width == -1) { m = xmalloc(sizeof(*m));