<div dir="ltr"><div>I don't think we have any feature test flags for diagnostic changes.</div><div><br></div>It sounds like the general problem is that two headers declare parts of the win32 API because windows.h is too much of a header dependence. Boost also isn't sure sure whether windows.h, from mingw or Microsoft, is using dllimport or not. Past versions of mingw have been inconsistent, so you can't just always declare it dllimport, like it should be.<div><br></div><div>I'm starting to feel like we should just downgrade this to a warning for free functions. We already make it a warning in other cases. Very few programs rely on function pointer identity, but global variable identity is often important.</div><div><br></div><div>Sound reasonable?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 21, 2015 at 12:36 PM, Edward Diener <span dir="ltr"><<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the latest clang built from source, if a function is mismatched as to a difference in dllimport attributes clang produces an error. As in:<br>
<br>
C:\Utilities\mingw-w64\i686-5.1.0-posix-dwarf-rt_v4-rev0\mingw32\i686-w64-mingw32\include\synchapi.h:127:26: error: redeclaration of 'Sleep' cannot add 'dllimport' attribute<br>
  WINBASEAPI VOID WINAPI Sleep (DWORD dwMilliseconds);<br>
                         ^<br>
..\..\..\boost/smart_ptr/detail/yield_k.hpp:67:29: note: previous declaration is here<br>
  extern "C" void __stdcall Sleep( unsigned long ms );<br>
<br>
Changing the latter to:<br>
<br>
  extern "C" __declspec(dllimport) void __stdcall Sleep( unsigned long ms );<br>
<br>
fixes the problem for clang.<br>
<br>
Earlier versions of clang ( 3.4.1, 3.5.2, 3.6.1 ) did not have this problem. Is there a __has_feature or __has_extension that I can use to test this change in the latest clang ? The previous versions are also happy with the __declspec(dllimport) added in the declaration so even without a __has_feature or __has_extension I can just test for clang on Windows, but I like to be as precise as possible in Boost code.<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>