aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'init.c')
-rw-r--r--init.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/init.c b/init.c
index 794b5a4..0d6621c 100644
--- a/init.c
+++ b/init.c
@@ -78,7 +78,7 @@ subobj(struct initparser *p, struct type *t, uint64_t off)
off += p->sub->offset;
if (++p->sub == p->obj + LEN(p->obj))
fatal("internal error: too many designators");
- p->sub->type = typeunqual(t, NULL);
+ p->sub->type = t;
p->sub->offset = off;
p->sub->iscur = false;
}
@@ -206,7 +206,6 @@ parseinit(struct scope *s, struct type *t)
struct expr *expr;
struct type *base;
- t = typeunqual(t, NULL);
p.cur = NULL;
p.sub = p.obj;
p.sub->offset = 0;
@@ -238,7 +237,7 @@ parseinit(struct scope *s, struct type *t)
case TYPEARRAY:
if (expr->decayed && expr->unary.base->kind == EXPRSTRING) {
expr = expr->unary.base;
- base = typeunqual(t->base, NULL);
+ base = t->base;
/* XXX: wide string literals */
if (!(typeprop(base) & PROPCHAR))
error(&tok.loc, "array initializer is string literal with incompatible type");