From: Wolfgang Bumiller Date: Thu, 20 Dec 2012 19:40:59 +0000 (+0100) Subject: Fix the -fcorrect-logic condition X-Git-Tag: 0.2~43 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=68c4070f62c785b67527e372e2bf82a19915c9b9;p=xonotic%2Fgmqcc.git Fix the -fcorrect-logic condition --- diff --git a/parser.c b/parser.c index 4251d02..123241f 100644 --- a/parser.c +++ b/parser.c @@ -1910,8 +1910,10 @@ static ast_expression* process_condition(parser_t *parser, ast_expression *cond, } ifnot = !ifnot; } - if (OPTS_FLAG(CORRECT_LOGIC)) { - /* everything must use a NOT_ */ + if (OPTS_FLAG(CORRECT_LOGIC) && + !(cond->expression.vtype == TYPE_STRING && OPTS_FLAG(TRUE_EMPTY_STRINGS))) + { + /* non-floats need to use NOT; except for strings on -ftrue-empty-strings */ unary = (ast_unary*)cond; if (!ast_istype(cond, ast_unary) || unary->op < INSTR_NOT_F || unary->op > INSTR_NOT_FNC) {