GCC compile problem:struct A have a member variable which is just a struct type name?
my code is as follow:
typedef struct a
{
uint32_t ulMsgType;
} a;
typedef struct b
{
a;
uint32_t ulIfCount;
} b;
b *pb;
if my code use pb->ulMsgType, then GCC (4.1.1 20061011) cannot compile it ,it will output an error that struct b doesn't have member "ulMsgType".
But if I run the code in a cross-compile environment, just like hardhat3.0, using xscale_be-gcc(3.2.1 20020930), the code can be compiled successfully.
So my questions is what should i do to make it compile successfully?
Whether I could add some options for GCC (4.1.1 20061011) to fix the problem, if so, what options should I add?
-------------------------
OS: 2.6.18-1.2798.fc6
|