PDA

View Full Version : Creator indentation loses context



melon
9th August 2010, 12:27
Hi there,

Not sure if this was brought up before, but here's the thing, consider following schema:

/* some commented code /* level two commented code */

For example:


/* proper comment */
void f1(int b){
int x = b;
}

//magic indentation below ;)

/* double comment
/* that I'd like to have */
void f2(int c){
int notHere = c;
if (c == 1){
int evenWorse = 4;
}
}


Code like this will compile as normal, but Creator's auto-indentation loses context as you can see in lines 10-15.

Not sure if it is a bug, maybe that kind of comments should not be used at all (but why?).

The compiler gives a warning about this.

Lykurg
9th August 2010, 12:34
You can't nest comments. It's a convention thing. Better avoid them.