[libcxxabi] r235828 - libc++abi: silence some warnings

Saleem Abdulrasool compnerd at compnerd.org
Sun Apr 26 19:21:52 PDT 2015


Author: compnerd
Date: Sun Apr 26 21:21:52 2015
New Revision: 235828

URL: http://llvm.org/viewvc/llvm-project?rev=235828&view=rev
Log:
libc++abi: silence some warnings

Cleans up the -Wundef warning caused by the use of the __LITTLE_ENDIAN__ macro.
Instead use `__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__`.  `__BYTE_ORDER__` is
defined by GCC since 4.2 and by clang.  This avoids the undef case where a macro
may be undefined.  This has previously caught real errors in libunwind.

Modified:
    libcxxabi/trunk/src/cxa_demangle.cpp

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=235828&r1=235827&r2=235828&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Sun Apr 26 21:21:52 2015
@@ -195,7 +195,7 @@ parse_floating_number(const char* first,
         }
         if (*t == 'E')
         {
-#if __LITTLE_ENDIAN__
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
             std::reverse(buf, e);
 #endif
             char num[float_data<Float>::max_demangled_size] = {0};





More information about the cfe-commits mailing list