|
Boost : |
Subject: Re: [boost] [winapi] Problem with the latest clang on Windows
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-05-31 20:44:23
On 31 May 2015 at 20:07, Edward Diener wrote:
> It seems like the fix for clang is to leave out the
> __declspec(dllimport) portion of all these Boost winapi calls while
> leaving it in for everybody else. I am discussing this on the clang
> developers mailing list but it seems like they are pretty adamant that
> if they see __attribute__((dllimport)) in from of a function declaration
> and do not see it in front of another function declaration, despite the
> rest of the signatire being the same, the two declarations are not the
> same function being declared and therefore an error because of ODR.
Oddly enough this topic came up at C++ Now when I was chatting with
Chandler.
They are immovable on clang being standards conformant in mingw mode.
That means API declarations must match. Else it's a bug, and it will
be errored out. Just because MSVC uses sloppy declspec doesn't mean
it's valid C++. They will not back down, or change their mind on
this, period.
Switching clang into msvc mode makes everything just work.
For reference. Boost.Thread no longer compiles at all on clang in
mingw mode for the same reason, but nearly gets there with clang in
msvc mode. I suspect plenty more libraries are similar. At some point
we'll need to go fix up all our code.
Niall
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk