Skip to content

Commit

Permalink
fbc: remove extra parentheses in gcc emitter
Browse files Browse the repository at this point in the history
- 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))'
  • Loading branch information
jayrm committed Oct 1, 2023
1 parent be87cc2 commit d75fa14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/compiler/ir-hlc.bas
Expand Up @@ -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 )
Expand Down

0 comments on commit d75fa14

Please sign in to comment.