turn the message about global variable double-declaration into a warning instead of an error on std != gmqcc

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-23 22:30:35 +01:00
parent 39b8b6a660
commit 86f3ef2194

View file

@ -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)))