I am trying to compile the below code using mingw.

#include "stdio.h"

typedef struct MyStruct MyStruct;
typedef struct MyStruct {
int x;

int main()
printf(" main");
return 0;

I am getting this error:
test.c:6: error: redefinition of typedef 'MyStruct'
test.c:3: error: previous declaration of 'MyStruct' was here

Is it possible to suppress these errors (some cmd line option that minGW supports)?

I am able to succesfully compile the same using Win32 and RVCT22 compilers.

Is there any solution for this? Is it a bug in MinGW ?

Thanks in advance

Connect more, do more and share more with Yahoo! India Mail. Learn more.