<div dir="rtl"><div dir="ltr">I'ts a good question wether <span style="font-size:12.8000001907349px">__attribute__((dllimport)) should really be ignored here but we'll probably want to in order to keep compatibility with mingw. Could you file a bug report on this?</span></div><div dir="ltr"><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-06-01 3:20 GMT+03:00 Edward Diener <span dir="ltr"><<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 5/31/2015 3:26 PM, Yaron Keren wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Maybe gcc is more fogiving with checking redeclarations or some compiler<br>
predefine is not the same. You can check this in depth by looking at<br>
preprocess output (-E) and comparing how both compilers expand the<br>
GetSystemTimeAsFileTime declaration.<br>
</blockquote>
<br></span>
Both compilers expand the different GetSystemTimeAsFileTime declaration in the internal Boost winapi headers and the mingw headers in exactly the same way.<br>
<br>
The preprocessed expansion in the internal Boost winapi header is:<br>
<br>
     __attribute__((dllimport)) void __attribute__((__stdcall__))<br>
         GetSystemTimeAsFileTime(FILETIME_* lpFileTime);<br>
<br>
and the preprocessed expansion in the mingw headers is:<br>
<br>
     void __attribute__((__stdcall__)) GetSystemTimeAsFileTime(LPFILETIME);<br>
<br>
where FILETIME_ and LPFILETIME are the same structure.<br>
<br>
The gcc compiler sees these declarations as the same but the clang compiler sees them as different and therefore an error.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<br>
2015-05-31 21:50 GMT+03:00 Edward Diener<br>
<<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a><br></span>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>>>:<span class=""><br>
<br>
    On 5/31/2015 2:05 PM, Yaron Keren wrote:<br>
<br>
        Boost tries to supplies its own version of the Windows API to avoid<br>
        including WIndows.h<br>
        Boost version of the API is not strictly identical to Windows.h,<br>
        so if<br>
        Windows.h do get included somehow such errors happen. I always<br>
        -DBOOST_USE_WINDOWS_H to force Boost to use Windows.h instead of<br>
        its own.<br>
<br>
<br>
    Thanks, that does work.<br>
<br>
    I still would like to know why clang is giving errors in the<br>
    situation I describe in my OP and gcc is not. I am not saying that<br>
    clang is wrong to do so but clearly it is not being compatible with<br>
    gcc in this area.<br>
<br>
<br>
<br>
<br>
        2015-05-31 20:48 GMT+03:00 Edward Diener<br>
        <<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a><br>
        <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>><br></span>
        <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a><div><div class="h5"><br>
        <mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>>>>:<br>
<br>
<br>
             Compiling some Boost library code the latest clang has<br>
        produced an<br>
             inconsistency with gcc on Windows that is making it<br>
        impossible to<br>
             build Boost libraries successfully.<br>
<br>
             The code in question, where clang is given an error:<br>
<br>
                 clang-linux.compile.c++.without-pth<br>
<br>
        ..\..\..\bin.v2\libs\context\build\clang-linux-3.7.0\debug\threading-multi\windows\stack_traits.obj<br>
                 In file included from<br>
                 ..\..\..\libs\context\src\windows\stack_traits.cpp:24:<br>
                 In file included from ..\..\..\boost/thread.hpp:13:<br>
                 In file included from ..\..\..\boost/thread/thread.hpp:12:<br>
                 In file included from<br>
        ..\..\..\boost/thread/thread_only.hpp:15:<br>
                 In file included from<br>
                 ..\..\..\boost/thread/win32/thread_data.hpp:10:<br>
                 In file included from<br>
        ..\..\..\boost/thread/thread_time.hpp:10:<br>
                 In file included from<br>
                 ..\..\..\boost/date_time/microsec_time_clock.hpp:23:<br>
                 ..\..\..\boost/date_time/filetime_functions.hpp:57:46:<br>
        error:<br>
                 conflicting types for 'GetSystemTimeAsFileTime'<br>
                          __declspec(dllimport) void __stdcall<br>
                 GetSystemTimeAsFileTime(FILETIME* lpFileTime);<br>
                                                               ^<br>
                 /mingw/include\winbase.h:1397:24: note: previous<br>
        declaration is here<br>
                 WINBASEAPI void WINAPI GetSystemTimeAsFileTime(LPFILETIME);<br>
<br>
                                       ^<br>
<br>
             and more of the same in many places building Boost<br>
        libraries with clang.<br>
<br>
             This is with the latest clang, which I build with<br>
        mingw/gcc-4.8.1 on<br>
             Windows.<br>
<br>
             With gcc-4.8.1:<br>
<br>
                 gcc.compile.c++<br>
<br>
        ..\..\..\bin.v2\libs\context\build\gcc-mingw-4.8.1\debug\threading-multi\windows\stack_traits.o<br>
<br>
<br>
             With gcc-4.9.2<br>
<br>
                 gcc.compile.c++<br>
<br>
        ..\..\..\bin.v2\libs\context\build\gcc-mingw-4.9.2\debug\threading-multi\windows\stack_traits.o<br>
<br>
<br>
             This is happening extensively in Boost code which uses the<br>
        Windows<br>
             API when compiling under Windows.<br>
<br>
             I do not know what WINBASEAPI is supposed to resove to<br>
        under mingw,<br>
             but clearly it should not be different for gcc and clang under<br>
             Windows and gcc has no problems with this.<br>
</div></div></blockquote><div class="HOEnZb"><div class="h5">
<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" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>