This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C99 parsing error?
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Jamie Lokier <jamie at shareable dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 18 May 2003 14:35:33 +0100 (BST)
- Subject: Re: C99 parsing error?
- References: <20030518082723.GA6350@mail.jlokier.co.uk>
On Sun, 18 May 2003, Jamie Lokier wrote:
> Is it really not permitted to write this in C99?:
>
> while (--length >= 0)
> {
> loop:
> int byte = *data++;
>
> GCC 3.2.2 reports: parse error before "int"
> If I replace "loop:" with "loop:;", it's fine.
> Perhaps GCC is correct to reject this, but it is surprising.
A compound statement is a sequence of statements and declarations; only
statements can have labels; see 6.8.1 and 6.8.2. The existing GCC
extension of attributes on labels means that we don't accept labels on
declarations as an extension either.
--
Joseph S. Myers
jsm28@cam.ac.uk