/* returns true if it counts as an error */
static bool GMQCC_WARN parsewarning(parser_t *parser, int warntype, const char *fmt, ...)
{
+ bool r;
va_list ap;
- int lvl = LVL_WARNING;
-
- if (!OPTS_WARN(warntype))
- return false;
-
- if (opts.werror) {
- parser->errors++;
- lvl = LVL_ERROR;
- }
-
va_start(ap, fmt);
- con_vprintmsg(lvl, parser->lex->tok.ctx.file, parser->lex->tok.ctx.line, (opts.werror ? "error" : "warning"), fmt, ap);
+ r = vcompile_warning(parser->lex->tok.ctx, warntype, fmt, ap);
va_end(ap);
-
- return opts.werror;
+ return r;
}
static bool GMQCC_WARN genwarning(lex_ctx ctx, int warntype, const char *fmt, ...)
{
+ bool r;
va_list ap;
- int lvl = LVL_WARNING;
-
- if (!OPTS_WARN(warntype))
- return false;
-
- if (opts.werror)
- lvl = LVL_ERROR;
-
va_start(ap, fmt);
- con_vprintmsg(lvl, ctx.file, ctx.line, (opts.werror ? "error" : "warning"), fmt, ap);
+ r = vcompile_warning(ctx, warntype, fmt, ap);
va_end(ap);
-
- return opts.werror;
+ return r;
}
/**********************************************************************
}
else
assignop = type_storep_instr[exprs[0]->expression.vtype];
- if (!ast_compare_type(field->expression.next, exprs[1])) {
+ if (assignop == AINSTR_END ||
+ !ast_compare_type(field->expression.next, exprs[1]))
+ {
ast_type_to_string(field->expression.next, ty1, sizeof(ty1));
ast_type_to_string(exprs[1], ty2, sizeof(ty2));
if (OPTS_FLAG(ASSIGN_FUNCTION_TYPES) &&
}
else
{
- parseerror(parser, "unrecognized hash-keyword: `%s`", parser_tokval(parser));
+ (void)!parsewarning(parser, WARN_UNKNOWN_PRAGMAS, "ignoring #pragma %s", parser_tokval(parser));
return false;
}