aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index cb7e221..a833b17 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -6012,7 +6012,10 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c,
if (have_elem &&
!(type->t & VT_ARRAY) &&
- is_compatible_types(type, &vtop->type)) {
+ /* Use i_c_parameter_t, to strip toplevel qualifiers.
+ The source type might have VT_CONSTANT set, which is
+ of course assignable to a non-const elements. */
+ is_compatible_parameter_types(type, &vtop->type)) {
init_putv(type, sec, c);
} else if (type->t & VT_ARRAY) {
s = type->ref;