Forward referencing with typedef

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

 



Hi,

Please refer to the following code snippet.

struct strArr;

typedef struct strArr myStAr[17];

typedef struct
{
	unsigned short DISPLAY_:1;
} structDisp;

typedef structDisp disp;

struct strArr
{
	disp dispBit;
} ;

int f()
{
	return 0;
}


In the code we have a typedef to an array of struct.

Now since the definition of that struct is given after the use, gcc cribs.

The error reported by gcc is : array type has incomplete element type.

Interesting thing is gcc 3.4.4 compiles the code where as gcc 4.3.4 and 4.6
doesn't.

I think this is a gcc bug.

Request assistance for the same.

Thanks and Regards,
Divyesh
-- 
View this message in context: http://old.nabble.com/Forward-referencing-with-typedef-tp32939060p32939060.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[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