"Incomplete type" and "redefinition" errors in gcc
Gabriel Dos Reis
gdr@integrable-solutions.net
Mon Nov 24 16:14:00 GMT 2003
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
More information about the Gcc-help
mailing list