Make initialized globals non-constant

This is for modern code. Traditional code still treats initialized
globals as constant and nosave. This will make a bit of a mess of
modern code that expects traditional behavior.
This commit is contained in:
Bill Currie 2019-06-09 19:23:23 +09:00
parent b7b6a89b91
commit d9c9686288
1 changed files with 5 additions and 2 deletions

View File

@ -578,8 +578,11 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space,
type_size (sym->type) * sizeof (pr_type_t));
}
}
sym->s.def->initialized = sym->s.def->constant = 1;
sym->s.def->nosave = 1;
sym->s.def->initialized = 1;
if (options.traditional) {
sym->s.def->constant = 1;
sym->s.def->nosave = 1;
}
}
}
sym->s.def->initializer = init;