J
Jeff Mott
Given the following example code
typedef
struct fubar *
fubar;
struct fubar
{
};
int main(void)
{
return 0;
}
GCC on Windows will compile this fine, but G++ throws an error saying
3: error: conflicting types for 'typedef struct fubar*fubar'
2: error: previous declaration as 'struct fubar'
6: error: conflicting types for 'struct fubar'
3: error: previous declaration as 'typedef struct fubar*fubar'
Now I know I can avoid this error by simply renaming the struct to
something else, but I'd prefer to understand why this is interpreted
differently.
typedef
struct fubar *
fubar;
struct fubar
{
};
int main(void)
{
return 0;
}
GCC on Windows will compile this fine, but G++ throws an error saying
3: error: conflicting types for 'typedef struct fubar*fubar'
2: error: previous declaration as 'struct fubar'
6: error: conflicting types for 'struct fubar'
3: error: previous declaration as 'typedef struct fubar*fubar'
Now I know I can avoid this error by simply renaming the struct to
something else, but I'd prefer to understand why this is interpreted
differently.