a few times now the compiler (gcc) with in code blocks has thrown an error in the end out of frustration i have deleted the offending line and commented out the relevant bit of code compiled it then re added the offending line and removed the comments only to find it now compiles fine.
the latest example of odd behavour is i have a program i have written upon changing it i discovered i had a missing closing curly bracket at the end of an if else statement. yet when i put the missing closing curly bracket in it threw an error saying expected " opening curly bracket " before closing curly bracket token. i copied and pasted it into a word editor as its a long function and difficult to see where all the brackets line up. lo and behold the "missing" closing curly bracket is there. to make it clearer below is a snipit of what i see in code blocks and what i see when i copy and paste.
Code:
//i see this
}
default:
//printf("Illegal move");
value_to_return = -1;
}
}
}
else
{
//return -1;
//missing } here
return value_to_return;
}
//this is the copy and paste verstion
}
default:
//printf("Illegal move");
value_to_return = -1;
}
}
}
else
{
//return -1;
}
return value_to_return;
}
while this may be a minor annoyance to some it makes it doubly difficult o learn c when things that are visualy wrong compile correctly or right but compile as wrong.
Just wondering if anyone else has experienced this and how it can be over come if at all.