diff --git a/tools/qfcc/include/expr.h b/tools/qfcc/include/expr.h index 73d3f2399..f52930730 100644 --- a/tools/qfcc/include/expr.h +++ b/tools/qfcc/include/expr.h @@ -211,6 +211,7 @@ typedef struct expr_s { } expr_t; extern struct type_s *ev_types[]; +extern const char *expr_names[]; /** Report a type mismatch error. diff --git a/tools/qfcc/source/dot_expr.c b/tools/qfcc/source/dot_expr.c index accd8485a..43578a1c8 100644 --- a/tools/qfcc/source/dot_expr.c +++ b/tools/qfcc/source/dot_expr.c @@ -52,7 +52,7 @@ #include "qc-parse.h" #include "strpool.h" -static const char *expr_names[] = +const char *expr_names[] = { "error", "state", diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index 7c0fb693f..f86ae8d47 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -1017,7 +1017,8 @@ statement_subexpr (sblock_t *sblock, expr_t *e, operand_t **op) if (e->type > ex_value) internal_error (e, "bad expression type"); if (!sfuncs[e->type]) - internal_error (e, "unexpected expression type"); + internal_error (e, "unexpected expression type; %s", + expr_names[e->type]); sblock = sfuncs[e->type] (sblock, e, op); return sblock;