S
saibot
Hi,
the following snippet of code does not compile with gcc 3.3. Why? It
works when I take "typedef test test_t" instead, but this is not what
I want.
I admit that I do not fully understand this "typedef test test_t[1]"
trick which I copied from the GNU MP library. Could somebody please
explain?
TIA,
Tobias
=====================================================================
typedef struct
{
int x;
} test;
typedef test test_t[1];
int main()
{
void* a;
test_t* b;
b = (test_t*)a; /* this does work */
(*b) = *(test_t*)a; /* this does not work: "incompatible types
in assignment" */
return 0;
}
the following snippet of code does not compile with gcc 3.3. Why? It
works when I take "typedef test test_t" instead, but this is not what
I want.
I admit that I do not fully understand this "typedef test test_t[1]"
trick which I copied from the GNU MP library. Could somebody please
explain?
TIA,
Tobias
=====================================================================
typedef struct
{
int x;
} test;
typedef test test_t[1];
int main()
{
void* a;
test_t* b;
b = (test_t*)a; /* this does work */
(*b) = *(test_t*)a; /* this does not work: "incompatible types
in assignment" */
return 0;
}