[llvm-commits] [llvm] r60616 - /llvm/trunk/lib/System/Unix/Signals.inc

Dan Gohman gohman at apple.com
Fri Dec 5 15:39:24 PST 2008


Author: djg
Date: Fri Dec  5 17:39:24 2008
New Revision: 60616

URL: http://llvm.org/viewvc/llvm-project?rev=60616&view=rev
Log:
Don't use plain %x to print pointer values. I had changed it from %p
since %p isn't formatted consistently, but obviously plain %x is wrong.
PRIxPTR with a cast to uintptr_t would work here, but that requires
inconvenient build-system changes. %lu works on all current and
foreseable future hosts.

Modified:
    llvm/trunk/lib/System/Unix/Signals.inc

Modified: llvm/trunk/lib/System/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=60616&r1=60615&r2=60616&view=diff

==============================================================================
--- llvm/trunk/lib/System/Unix/Signals.inc (original)
+++ llvm/trunk/lib/System/Unix/Signals.inc Fri Dec  5 17:39:24 2008
@@ -97,7 +97,8 @@
     if (name == NULL) fprintf(stderr, " %-*s", width, dlinfo.dli_fname);
     else              fprintf(stderr, " %-*s", width, name+1);
 
-    fprintf(stderr, " %#0*x", (int)(sizeof(void*) * 2) + 2, StackTrace[i]);
+    fprintf(stderr, " %#0*lx",
+            (int)(sizeof(void*) * 2) + 2, (unsigned long)StackTrace[i]);
 
     if (dlinfo.dli_sname != NULL) {
       int res;





More information about the llvm-commits mailing list