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 792beff25a6ca5aaf26d5a6dd2449f2e0aefbebb
parent 8040e25abcad4b106514315a53f4723e3a387959
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 13 Feb 2019 15:42:43 -0800

Ignore qualifiers when parsing initializers

Diffstat:
Minit.c | 2+-
Atests/const-init.c | 1+
Atests/const-init.qbe | 1+
3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/init.c b/init.c @@ -211,7 +211,7 @@ parseinit(struct scope *s, struct type *t) p.cur = NULL; p.sub = p.obj; p.sub->offset = 0; - p.sub->type = t; + p.sub->type = typeunqual(t, NULL); for (;;) { if (p.cur) { if (tok.kind == TLBRACK || tok.kind == TPERIOD) diff --git a/tests/const-init.c b/tests/const-init.c @@ -0,0 +1 @@ +const struct {struct {int x, y;} t;} s = {{{1}, 2}}; diff --git a/tests/const-init.qbe b/tests/const-init.qbe @@ -0,0 +1 @@ +export data $s = align 4 { w 1, w 2, }