Closed TotallyGamerJet closed 2 years ago
Yes, it's an optimization that cxgo does. It should only do that if there's no declarations in that scope.
So in testing some other cases I have come to the conclusion that it has nothing to do with the define. Just putting the blocks directly inside the if statement gets them removed. It also doesn't matter if there are many or few lines in the block it always gets removed while inside an if statement. Do you know where this optimization code is so I can look for the bug?
Using a define that contains a block scope inside of an if statement removes the brackets. Given:
The generated code:
I would expect there to be an inner bracket for each time the define is used. This might be an issue with the preprocessor but I didn't know if CXGO does some "optimization" that would remove these brackets unintentionally. If there isn't an if statement the brackets are generated.