<div dir="rtl"><div dir="ltr">Well, this was fixed in Boost 1.5.7 released ten days ago:</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">//  However, using the GCC version number fails when the compiler is clang since this</div><div dir="ltr">//  only ever claims to emulate GCC-4.2, see <a href="https://svn.boost.org/trac/boost/ticket/7473" target="_blank">https://svn.boost.org/trac/boost/ticket/7473</a></div><div dir="ltr">//  for a long discussion on this issue.  What we can do though is use clang's __has_include</div><div dir="ltr">//  to detect the presence of a C++11 header that was introduced with a specific GCC release.</div><div dir="ltr">//  We still have to be careful though as many such headers were buggy and/or incomplete when</div><div dir="ltr">//  first introduced, so we only check for headers that were fully featured from day 1, and then</div><div dir="ltr">//  use that to infer the underlying GCC version:</div><div><br></div></div><div dir="ltr"><br></div></div><div class="gmail_extra"><div dir="ltr"><br><div class="gmail_quote">2014-11-13 6:50 GMT+02:00 Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div dir="rtl"><div dir="ltr">The doc say that clang still does not support __builtin_va_arg_pack/__builtin_va_arg_pack_len:</div><div dir="ltr"><br></div><div dir="ltr">  <a href="http://clang.llvm.org/docs/UsersManual.html#gcc-extensions-not-implemented-yet" target="_blank">http://clang.llvm.org/docs/UsersManual.html#gcc-extensions-not-implemented-yet</a><br></div><div dir="ltr"><br></div><div dir="ltr">My use case for the newer gcc version is boost config, which conditions its TR1 headers based on gcc version. clang claim to be 4.2 may introduce a difference when switching to clang, since gcc 4.8 will use the libstdc++ boost headers while switching to clang will use the boost headers. In one complex case actually fails to compile with #include <something> failing, where it seems the boost code does not expect <something> to exist since it did not in libstdc++ of gcc 4.2 at all while it does exist in libstdc++ of gcc 4.9 which is the real version.</div><div dir="ltr"><br></div><div dir="ltr">Other libraries than boost dont have their own TR1 replacement headers and will probably have reduced functionality with clang = gcc 4.2. </div><div dir="ltr"><br></div><div dir="ltr">It may be better have clang pretend gcc 4.8 and patch the glibc conditional rather than all other libraries?</div><div dir="ltr"><br></div><div dir="ltr">Examples from boost config:</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font face="monospace">//  C++0x headers in GCC 4.3.0 and later</font></div><div dir="ltr"><font face="monospace">//</font></div><div dir="ltr"><font face="monospace">#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_ARRAY</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_TUPLE</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_UNORDERED_MAP</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_UNORDERED_SET</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_FUNCTIONAL</font></div><div dir="ltr"><font face="monospace">#endif</font></div><div dir="ltr"><font face="monospace"><br></font></div><div dir="ltr"><font face="monospace">//  C++0x headers in GCC 4.4.0 and later</font></div><div dir="ltr"><font face="monospace">//</font></div><div dir="ltr"><font face="monospace">#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_FORWARD_LIST</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_INITIALIZER_LIST</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_MUTEX</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_RATIO</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_SYSTEM_ERROR</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_SMART_PTR</font></div><div dir="ltr"><font face="monospace">#else</font></div><div dir="ltr"><font face="monospace">#  define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG </font></div><div dir="ltr"><font face="monospace">#  define BOOST_HAS_TR1_COMPLEX_OVERLOADS </font></div><div dir="ltr"><font face="monospace">#endif</font></div><div dir="ltr"><font face="monospace"><br></font></div><div dir="ltr"><font face="monospace">#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_CXX11_HDR_MUTEX))</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE</font></div><div dir="ltr"><font face="monospace">#  define BOOST_NO_CXX11_HDR_MUTEX</font></div><div dir="ltr"><font face="monospace">#endif</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">...</font></div><div><br></div></div><div><div class="h5"><div dir="ltr"><br></div><div dir="ltr"><br></div><div class="gmail_extra"><div dir="ltr"><br></div><div dir="ltr"><br><div class="gmail_quote">2014-11-13 1:04 GMT+02:00 Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;border-right-width:1px;border-right-color:rgb(204,204,204);border-right-style:solid;padding-left:1ex;padding-right:1ex">This was discussed in this thread <a href="http://marc.info/?t=133682946900003&r=1&w=2" target="_blank">http://marc.info/?t=133682946900003&r=1&w=2</a> People were generally supportive of the idea, but it was deemed very hard to get glibc to build with this ( <a href="http://marc.info/?l=cfe-dev&m=133717592322519&w=2" target="_blank">http://marc.info/?l=cfe-dev&m=133717592322519&w=2</a> ) and the benefit of doing this wasn't seen as very big in the end.</blockquote></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Nov 12, 2014 at 2:55 PM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="rtl"><div dir="ltr">gcc 4.2.1 is really old from 2008.  Some configuration headers such as boost "libstdcpp3.hpp" behave differently for pre-gcc 4.3 or later. </div><div dir="ltr"><br></div><div dir="ltr">gcc 4.8.1 is more recent, reasonable claim for clang. </div><div dir="ltr"><br></div><div dir="ltr">I had tried going for 4.9.1 but encountered a problem with intrinsics in mingw 4.9.1 intrin.h which are treated differently for gcc 4.9 or later:</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"> * On GCC 4.9 we may always include those headers. On older GCCs, we may do it only if CPU</div><div dir="ltr"> * features used by them are enabled, so we need to check macros like __SSE__ or __MMX__ first.</div><div dir="ltr"> */</div><div dir="ltr">#if __MINGW_GNUC_PREREQ(4, 9)</div><div dir="ltr">#define __MINGW_FORCE_SYS_INTRINS</div><div dir="ltr">#endif</div><div>...</div><div><br></div><div>this does not work correctly with clang since the headers try to use SSE3 instructions without __SSE3__ being defined and fail.</div><div><br></div></div></div>
<br></div></div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div></div></div></div></div>
</blockquote></div></div></div>