[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
|
@ -1014,11 +1014,20 @@ non_code_func
|
||||||
}
|
}
|
||||||
| '=' expr
|
| '=' expr
|
||||||
{
|
{
|
||||||
symbol_t *sym = $<symbol>0;
|
if (local_expr) {
|
||||||
specifier_t spec = $<spec>-1;
|
symbol_t *sym = $<symbol>0;
|
||||||
initialize_def (sym, $2, current_symtab->space, spec.storage);
|
specifier_t spec = $<spec>-1;
|
||||||
if (sym->s.def)
|
initialize_def (sym, $2, current_symtab->space, spec.storage);
|
||||||
sym->s.def->nosave |= spec.nosave;
|
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 */
|
| /* emtpy */
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue