This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: "Incomplete type" and "redefinition" errors in gcc
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Richard dot Earnshaw at arm dot com
- Cc: Ashutosh Dixit <ddixitt at yahoo dot com>, gcc at gcc dot gnu dot org, gcc-help at gcc dot gnu dot org
- Date: 24 Nov 2003 17:11:20 +0100
- Subject: Re: "Incomplete type" and "redefinition" errors in gcc
- Organization: Integrable Solutions
- References: <200311241556.hAOFuZo11705@pc960.cambridge.arm.com>
Richard Earnshaw <rearnsha@arm.com> writes:
| > Hi,
| >
| > If I compile the following simple C code with gcc:
| > ________________try.c________________________
| >
| > typedef enum VIDF VIDF;
| > typedef unsigned int U32;
| > typedef unsigned int U32;
[...]
| All of these diagnostics are correct. You can't repeat typedefs, and you
| can't instantiate a forward declaration of an enum.
I see the original poster was mentioning C. However, I just wanted to
add that in C++, it is permitted to repeat a typedef declaration
provided it binds the same tokens. The enum forward declaration
restrictions are same in both languages.
-- Gaby