dllimport and initialization issue

Michael Cronenworth mike at cchtml.com
Thu Jul 22 19:24:41 UTC 2010


This code compiles with no errors or warnings:
__attribute__ ((dllimport)) int _fmode;

This code does not compile:
__attribute__ ((dllimport)) int _fmode = _O_BINARY;
foo.c:123: error: variable '_fmode' definition is marked dllimport
foo.c:123: warning: '_fmode' redeclared without dllimport attribute: 
previous dllimport ignored

Am I doing something horribly wrong or is this a gcc bug?

rpm -q mingw32-gcc
mingw32-gcc-4.4.2-2.fc13.x86_64

Thanks,
Michael


More information about the mingw mailing list