mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 15:30:50 +00:00
[qfcc] Make initialization of external vars an error
This commit is contained in:
parent
051a572bcc
commit
b186332da0
2 changed files with 5 additions and 2 deletions
|
@ -575,7 +575,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space,
|
|||
internal_error (0, "half defined var");
|
||||
if (storage == sc_extern) {
|
||||
if (init)
|
||||
warning (0, "initializing external variable");
|
||||
error (0, "initializing external variable");
|
||||
return;
|
||||
}
|
||||
if (init && check->s.def->initialized) {
|
||||
|
@ -611,7 +611,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space,
|
|||
init_field_def (sym->s.def, init, storage);
|
||||
if (storage == sc_extern) {
|
||||
if (init)
|
||||
warning (0, "initializing external variable");
|
||||
error (0, "initializing external variable");
|
||||
return;
|
||||
}
|
||||
if (!init)
|
||||
|
|
|
@ -1021,6 +1021,9 @@ overloaded_identifier
|
|||
non_code_func
|
||||
: '=' '#' expr
|
||||
{
|
||||
if ($<spec>-1.storage == sc_extern) {
|
||||
error (0, "initializing external variable");
|
||||
}
|
||||
build_builtin_function ($<symbol>0, $3, 0);
|
||||
}
|
||||
| '=' expr
|
||||
|
|
Loading…
Reference in a new issue