mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 18:30:52 +00:00
parsewarning() now gets GMQCC_WARN since parsewarning returns whether or not the warning was treated as an error, thus we need to bail if it returns true
This commit is contained in:
parent
2d9623cbe8
commit
4d47c40cb9
1 changed files with 5 additions and 3 deletions
8
parser.c
8
parser.c
|
@ -62,7 +62,7 @@ void parseerror(parser_t *parser, const char *fmt, ...)
|
|||
}
|
||||
|
||||
/* returns true if it counts as an error */
|
||||
bool parsewarning(parser_t *parser, int warntype, const char *fmt, ...)
|
||||
bool GMQCC_WARN parsewarning(parser_t *parser, int warntype, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int lvl = LVL_WARNING;
|
||||
|
@ -1235,8 +1235,10 @@ static bool parser_parse_statement(parser_t *parser, ast_block *block, ast_expre
|
|||
parseerror(parser, "cannot declare a variable from here");
|
||||
return false;
|
||||
}
|
||||
if (opts_standard == COMPILER_QCC)
|
||||
parsewarning(parser, WARN_EXTENSIONS, "missing 'local' keyword when declaring a local variable");
|
||||
if (opts_standard == COMPILER_QCC) {
|
||||
if (parsewarning(parser, WARN_EXTENSIONS, "missing 'local' keyword when declaring a local variable"))
|
||||
return false;
|
||||
}
|
||||
if (!parser_variable(parser, block))
|
||||
return false;
|
||||
*out = NULL;
|
||||
|
|
Loading…
Reference in a new issue