This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Declaration after a label


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 cc me in your reply. Cheers,
Shaun

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]