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:
parent
b7b6a89b91
commit
d9c9686288
|
@ -578,8 +578,11 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space,
|
||||||
type_size (sym->type) * sizeof (pr_type_t));
|
type_size (sym->type) * sizeof (pr_type_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sym->s.def->initialized = sym->s.def->constant = 1;
|
sym->s.def->initialized = 1;
|
||||||
sym->s.def->nosave = 1;
|
if (options.traditional) {
|
||||||
|
sym->s.def->constant = 1;
|
||||||
|
sym->s.def->nosave = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sym->s.def->initializer = init;
|
sym->s.def->initializer = init;
|
||||||
|
|
Loading…
Reference in New Issue