From d75fa14537c5813af66f411c33cabb2f7507ceb0 Mon Sep 17 00:00:00 2001 From: coderJeff Date: Sun, 1 Oct 2023 07:34:49 -0400 Subject: [PATCH] fbc: remove extra parentheses in gcc emitter - eliminate warnings for -Wparentheses-equality due to changes in conditional 'if' expressions - noted to cause a warning in fbc/emscripten compilations - due to commit #94db491bd54a87293b5c56716a10fcd8ab53fc40 - change in ir-hlc.bas now emits logical not operator '(!(expr))' - however the extra parenthesis were emitted when logic is not inverted '((expr))' --- src/compiler/ir-hlc.bas | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compiler/ir-hlc.bas b/src/compiler/ir-hlc.bas index 787c09568..99864f153 100644 --- a/src/compiler/ir-hlc.bas +++ b/src/compiler/ir-hlc.bas @@ -2885,11 +2885,13 @@ private sub _emitBop _ static as string s s = "if( " if( (options and IR_EMITOPT_REL_DOINVERSE) <> 0 ) then - s += "!" + s += "!(" end if - s += "(" s += exprFlush( exprNewBOP( op, l, r ) ) - s += ") ) goto " + if( (options and IR_EMITOPT_REL_DOINVERSE) <> 0 ) then + s += ")" + end if + s += ") goto " s += *symbGetMangledName( label ) s += ";" hWriteLine( s )