[cfe-dev] x64 windows (MinGW) and "__declspec(dllimport)" emits a "unknown attribute warning"

NAKAMURA Takumi geek4civic at gmail.com
Mon Jul 18 16:07:16 PDT 2011


It must be a bug even if __attribute__((dllexport)) is not accepted on

> This small piece of code:
>> int main() {}
>> __declspec(dllexport) void foo (int); void bar (void) { foo (0); }
> emits following warning when Clang is built for x86_64-w64-mingw32,
> but not when built for i686-w64-mingw32:


Note, __declspec(dllexport) can be accepted (w/o macro substitution)
with -fms-extensions.
(FYI, IIRC, cygming-gcc does not accept __declspec. cygming header
should have the macro def)


More information about the cfe-dev mailing list