Re: "Incomplete type" and "redefinition" errors in gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Earnshaw <rearnsha@xxxxxxx> 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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux