News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Matching brace and preprocessor

Started by vix, July 17, 2009, 01:20:53 PM

Previous topic - Next topic

vix

I don't know if this is a known behaviour; I searched into the forum but I didn't find any information about it, so I started a new thread.
The Matching Brace feature doesn't work in the right way when there are some preprocessor directives.
For example if you have the following code
{
a++;
#if 0
if(a==1){
#else
if(b==2){
#endif
c = a+b;
}
c--;
}

the first '{' is highlighted as 'no matching brace', the one after "if(a==1)" is matched with the last one, and so on...

I know this could seem quite a strange piece of code, and in fact it is...
I know there is an easy workaround (i.e. moving all the '{' outside preprocessor directives),
but I only want to point out this unexpected behaviour.

Best regards

vix

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.