From: Wolfgang (Blub) Bumiller Date: Fri, 23 Nov 2012 21:30:35 +0000 (+0100) Subject: turn the message about global variable double-declaration into a warning instead... X-Git-Tag: 0.1.9~294 X-Git-Url: https://git.xonotic.org/?a=commitdiff_plain;h=86f3ef2194877065124b1330a372d6f03af4dfeb;p=xonotic%2Fgmqcc.git turn the message about global variable double-declaration into a warning instead of an error on std != gmqcc --- diff --git a/parser.c b/parser.c index 7d91aaa..41a8730 100644 --- a/parser.c +++ b/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)))