[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


Ruben,

It must be a bug even if __attribute__((dllexport)) is not accepted on
x86_64-mingw32.

> 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:

Interesting.

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)

...Takumi



More information about the cfe-dev mailing list