mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
turn the message about global variable double-declaration into a warning instead of an error on std != gmqcc
This commit is contained in:
parent
39b8b6a660
commit
86f3ef2194
1 changed files with 14 additions and 4 deletions
18
parser.c
18
parser.c
|
@ -3380,10 +3380,20 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield
|
|||
{
|
||||
/* other globals */
|
||||
if (old) {
|
||||
parseerror(parser, "global `%s` already declared here: %s:%i",
|
||||
var->name, ast_ctx(old).file, ast_ctx(old).line);
|
||||
retval = false;
|
||||
goto cleanup;
|
||||
if (opts_standard == COMPILER_GMQCC) {
|
||||
parseerror(parser, "global `%s` already declared here: %s:%i",
|
||||
var->name, ast_ctx(old).file, ast_ctx(old).line);
|
||||
retval = false;
|
||||
goto cleanup;
|
||||
} else {
|
||||
if (parsewarning(parser, WARN_DOUBLE_DECLARATION,
|
||||
"global `%s` already declared here: %s:%i",
|
||||
var->name, ast_ctx(old).file, ast_ctx(old).line))
|
||||
{
|
||||
retval = false;
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (opts_standard == COMPILER_QCC &&
|
||||
(old = parser_find_field(parser, var->name)))
|
||||
|
|
Loading…
Reference in a new issue