[libcxxabi] r230606 - Unwind: clean up some GCC warnings

Saleem Abdulrasool compnerd at compnerd.org
Wed Feb 25 20:01:37 PST 2015


Author: compnerd
Date: Wed Feb 25 22:01:37 2015
New Revision: 230606

URL: http://llvm.org/viewvc/llvm-project?rev=230606&view=rev
Log:
Unwind: clean up some GCC warnings

This cleans up a set of -Wsign-conversion, -Wint-conversion, and -Wformat
warnings from GCC 4.9.2 on Linux.  NFC.

Modified:
    libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp
    libcxxabi/trunk/src/Unwind/libunwind.cpp

Modified: libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp?rev=230606&r1=230605&r2=230606&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp (original)
+++ libcxxabi/trunk/src/Unwind/DwarfInstructions.hpp Wed Feb 25 22:01:37 2015
@@ -605,7 +605,7 @@ DwarfInstructions<A, R>::evaluateExpress
     case DW_OP_lit29:
     case DW_OP_lit30:
     case DW_OP_lit31:
-      value = opcode - DW_OP_lit0;
+      value = static_cast<pint_t>(opcode - DW_OP_lit0);
       *(++sp) = value;
       if (log)
         fprintf(stderr, "push literal 0x%" PRIx64 "\n", (uint64_t)value);
@@ -643,14 +643,14 @@ DwarfInstructions<A, R>::evaluateExpress
     case DW_OP_reg29:
     case DW_OP_reg30:
     case DW_OP_reg31:
-      reg = opcode - DW_OP_reg0;
+      reg = static_cast<uint32_t>(opcode - DW_OP_reg0);
       *(++sp) = registers.getRegister((int)reg);
       if (log)
         fprintf(stderr, "push reg %d\n", reg);
       break;
 
     case DW_OP_regx:
-      reg = (uint32_t)addressSpace.getULEB128(p, expressionEnd);
+      reg = static_cast<uint32_t>(addressSpace.getULEB128(p, expressionEnd));
       *(++sp) = registers.getRegister((int)reg);
       if (log)
         fprintf(stderr, "push reg %d + 0x%" PRIx64 "\n", reg, (uint64_t)svalue);
@@ -688,18 +688,18 @@ DwarfInstructions<A, R>::evaluateExpress
     case DW_OP_breg29:
     case DW_OP_breg30:
     case DW_OP_breg31:
-      reg = opcode - DW_OP_breg0;
+      reg = static_cast<uint32_t>(opcode - DW_OP_breg0);
       svalue = (sint_t)addressSpace.getSLEB128(p, expressionEnd);
-      svalue += registers.getRegister((int)reg);
+      svalue += static_cast<sint_t>(registers.getRegister((int)reg));
       *(++sp) = (pint_t)(svalue);
       if (log)
         fprintf(stderr, "push reg %d + 0x%" PRIx64 "\n", reg, (uint64_t)svalue);
       break;
 
     case DW_OP_bregx:
-      reg = (uint32_t)addressSpace.getULEB128(p, expressionEnd);
+      reg = static_cast<uint32_t>(addressSpace.getULEB128(p, expressionEnd));
       svalue = (sint_t)addressSpace.getSLEB128(p, expressionEnd);
-      svalue += registers.getRegister((int)reg);
+      svalue += static_cast<sint_t>(registers.getRegister((int)reg));
       *(++sp) = (pint_t)(svalue);
       if (log)
         fprintf(stderr, "push reg %d + 0x%" PRIx64 "\n", reg, (uint64_t)svalue);

Modified: libcxxabi/trunk/src/Unwind/libunwind.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/libunwind.cpp?rev=230606&r1=230605&r2=230606&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/libunwind.cpp (original)
+++ libcxxabi/trunk/src/Unwind/libunwind.cpp Wed Feb 25 22:01:37 2015
@@ -309,7 +309,8 @@ _LIBUNWIND_EXPORT void unw_save_vfp_as_X
 /// SPI: walks cached dwarf entries
 _LIBUNWIND_EXPORT void unw_iterate_dwarf_unwind_cache(void (*func)(
     unw_word_t ip_start, unw_word_t ip_end, unw_word_t fde, unw_word_t mh)) {
-  _LIBUNWIND_TRACE_API("unw_iterate_dwarf_unwind_cache(func=%p)\n", func);
+  _LIBUNWIND_TRACE_API("unw_iterate_dwarf_unwind_cache(func=%p)\n",
+                       reinterpret_cast<void *>(func));
   DwarfFDECache<LocalAddressSpace>::iterateCacheEntries(func);
 }
 





More information about the cfe-commits mailing list