Why is there a "typedef override" error with GCC 4.3 but not GCC 4.6?

I am developing my application using GCC 4.6 for compilation, but the user reported a "typedef override" error. After some confusion, when I improperly told the user to get the last source using Git, I looked carefully and found something similar to this:

/* mystruct.h */ #ifdef MYSTRUCT_H #define MYSTRUCT_H typedef struct _mystruct mystruct #endif /* mystruct.c */ #include "mystruct.h" typedef struct _mystruct { int a; int b; } mystruct; 

Which is pretty easy to fix for older versions of GCC, but why is this no longer a bug? Or does he need reporting?

+5
source share
1 answer

It looks like a deliberate change ...

I don't have 4.6, but it looks like you will get a warning if you use -pedantic .

+5
source

All Articles