<div dir="rtl"><div dir="ltr">Maybe gcc is more fogiving with checking redeclarations or some compiler predefine is not the same. You can check this in depth by looking at preprocess output (-E) and comparing how both compilers expand the GetSystemTimeAsFileTime declaration.</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2015-05-31 21:50 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 2:05 PM, Yaron Keren wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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, 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 its own.<br>
</blockquote>
<br></span>
Thanks, that does work.<br>
<br>
I still would like to know why clang is giving errors in the situation I describe in my OP and gcc is not. I am not saying that clang is wrong to do so but clearly it is not being compatible with gcc in this area.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<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></span>
<mailto:<a href="mailto:eldlistmailingz@tropicsoft.com" target="_blank">eldlistmailingz@tropicsoft.com</a>>>:<div><div class="h5"><br>
<br>
    Compiling some Boost library code the latest clang has produced an<br>
    inconsistency with gcc on Windows that is making it 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>
        ..\..\..\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 ..\..\..\boost/thread/thread_only.hpp:15:<br>
        In file included from<br>
        ..\..\..\boost/thread/win32/thread_data.hpp:10:<br>
        In file included from ..\..\..\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: 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 declaration is here<br>
        WINBASEAPI void WINAPI GetSystemTimeAsFileTime(LPFILETIME);<br>
<br>
                              ^<br>
<br>
    and more of the same in many places building Boost libraries with clang.<br>
<br>
    This is with the latest clang, which I build with mingw/gcc-4.8.1 on<br>
    Windows.<br>
<br>
    With gcc-4.8.1:<br>
<br>
        gcc.compile.c++<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>
        ..\..\..\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 Windows<br>
    API when compiling under Windows.<br>
<br>
    I do not know what WINBASEAPI is supposed to resove to 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>