mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[qfcc] Improve error messages for bad qc builtins
While global quakec functions could not be initialized to another function, the error messages were rather obscure.
This commit is contained in:
parent
78f552aa87
commit
0db617719e
1 changed files with 14 additions and 5 deletions
|
@ -1014,11 +1014,20 @@ non_code_func
|
|||
}
|
||||
| '=' expr
|
||||
{
|
||||
symbol_t *sym = $<symbol>0;
|
||||
specifier_t spec = $<spec>-1;
|
||||
initialize_def (sym, $2, current_symtab->space, spec.storage);
|
||||
if (sym->s.def)
|
||||
sym->s.def->nosave |= spec.nosave;
|
||||
if (local_expr) {
|
||||
symbol_t *sym = $<symbol>0;
|
||||
specifier_t spec = $<spec>-1;
|
||||
initialize_def (sym, $2, current_symtab->space, spec.storage);
|
||||
if (sym->s.def)
|
||||
sym->s.def->nosave |= spec.nosave;
|
||||
} else {
|
||||
if (is_integer_val ($2) || is_float_val ($2)) {
|
||||
error (0, "invalid function initializer."
|
||||
" did you forget #?");
|
||||
} else {
|
||||
error (0, "cannot create global function variables");
|
||||
}
|
||||
}
|
||||
}
|
||||
| /* emtpy */
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue