This may not be a very useful question, but I am curious.
The old C dialect in Visual Studio 2010 doesn't allow mixing declarations with executable statements, so this program gives an error:
int main(void) {
int a;
a = 1;
int b;
b = 2;
return 0;
}
However, the error reported is this:
error C2143: syntax error : missing ';' before 'type'
I'm at a loss which construction in its (obsolete) C grammar that the compiler thinks we are trying to use, and where a semicolon would help. I realize that it might just be a badly formulated error message, or an unintended effect of how the parser is written, but maybe there is something I'm missing.
EDIT:
Since several people have now answered this question with The old C dialect in Visual Studio 2010 doesn't allow mixing declarations with executable statements, or words to that effect, perhaps I didn't make myself very clear. Sorry about that. To try to clarify: Yes, I already know that. I'm just curious about the error message.