[libcxxabi] r224690 - Silence warnings in libunwind.

Logan Chien tzuhsiang.chien at gmail.com
Sun Dec 21 06:22:01 PST 2014


Author: logan
Date: Sun Dec 21 08:22:00 2014
New Revision: 224690

URL: http://llvm.org/viewvc/llvm-project?rev=224690&view=rev
Log:
Silence warnings in libunwind.

* Remove the embedded directive undefined behavior by moving the
  the #ifdef out of the macro arguments.  [-Wembedded-directive]

* Remove the local variable shadowing warning by renaming
  frameInfo in UnwindLevel1-gcc-ext.c.  [-Wshadow]

* Explicitly cast the function pointer to void pointer to avoid
  the comparison between function pointer and void pointer.
  [-Wpedantic]


Modified:
    libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp
    libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c

Modified: libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp?rev=224690&r1=224689&r2=224690&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp (original)
+++ libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp Sun Dec 21 08:22:00 2014
@@ -249,7 +249,7 @@ decode_eht_entry(const uint32_t* data, s
                                              _Unwind_Exception* unwind_exception,
                                              _Unwind_Context* context);
     void *PR = (void*)signExtendPrel31(*data);
-    if (PR == &__gxx_personality_v0) {
+    if (PR == (void*)&__gxx_personality_v0) {
       *off = 1; // First byte is size data.
       *len = (((data[1] >> 24) & 0xff) + 1) * 4;
     } else

Modified: libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c?rev=224690&r1=224689&r2=224690&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c (original)
+++ libcxxabi/trunk/src/Unwind/UnwindLevel1-gcc-ext.c Sun Dec 21 08:22:00 2014
@@ -25,12 +25,15 @@
 ///  Called by __cxa_rethrow().
 _LIBUNWIND_EXPORT _Unwind_Reason_Code
 _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) {
+#if LIBCXXABI_ARM_EHABI
   _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), "
                        "private_1=%ld\n",
                        exception_object,
-#if LIBCXXABI_ARM_EHABI
                        (long)exception_object->unwinder_cache.reserved1);
 #else
+  _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), "
+                       "private_1=%ld\n",
+                       exception_object,
                        (long)exception_object->private_1);
 #endif
 
@@ -145,14 +148,14 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb
     // debugging
     if (_LIBUNWIND_TRACING_UNWINDING) {
       char functionName[512];
-      unw_proc_info_t frameInfo;
+      unw_proc_info_t frame;
       unw_word_t offset;
       unw_get_proc_name(&cursor, functionName, 512, &offset);
-      unw_get_proc_info(&cursor, &frameInfo);
+      unw_get_proc_info(&cursor, &frame);
       _LIBUNWIND_TRACE_UNWINDING(
           " _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p\n",
-          (long long)frameInfo.start_ip, functionName, (long long)frameInfo.lsda,
-          &cursor);
+          (long long)frame.start_ip, functionName,
+          (long long)frame.lsda, &cursor);
     }
 
     // call trace function with this frame





More information about the cfe-commits mailing list