Declaration after a label

2006-03-31 Thread Shaun Jackman
GCC reports an error for this snippet: int main() { foo: int x; } foo.c:4: error: expected expression before 'int' ... but not this snippet: int main() { foo: (void)0; int x; } Is this expected behaviour? At the very least, it seems like an unusual distinction. Please

Re: Declaration after a label

2006-03-31 Thread Andreas Schwab
Shaun Jackman [EMAIL PROTECTED] writes: GCC reports an error for this snippet: int main() { foo: int x; } foo.c:4: error: expected expression before 'int' The C standard only allows labels to occur before statements. A declaration is not a statement. Andreas. -- Andreas