[PATCH] D63888: [llvm] [Support] Clean PrintStackTrace() ptr arithmetic up

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 2 04:35:19 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL364912: [llvm] [Support] Clean PrintStackTrace() ptr arithmetic up (authored by mgorny, committed by ).
Herald added a subscriber: kristina.

Changed prior to commit:
  https://reviews.llvm.org/D63888?vs=206904&id=207517#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63888/new/

https://reviews.llvm.org/D63888

Files:
  llvm/trunk/lib/Support/Unix/Signals.inc


Index: llvm/trunk/lib/Support/Unix/Signals.inc
===================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc
+++ llvm/trunk/lib/Support/Unix/Signals.inc
@@ -539,11 +539,8 @@
       else    OS << d;
       free(d);
 
-      // FIXME: When we move to C++11, use %t length modifier. It's not in
-      // C++03 and causes gcc to issue warnings. Losing the upper 32 bits of
-      // the stack offset for a stack dump isn't likely to cause any problems.
-      OS << format(" + %u",(unsigned)((char*)StackTrace[i]-
-                                      (char*)dlinfo.dli_saddr));
+      OS << format(" + %tu", (static_cast<const char*>(StackTrace[i])-
+                              static_cast<const char*>(dlinfo.dli_saddr)));
     }
     OS << '\n';
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63888.207517.patch
Type: text/x-patch
Size: 805 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/beeeb3b8/attachment.bin>


More information about the llvm-commits mailing list