[llvm-commits] [PATCH] Fix gcc/printf/ISO C++ warning

Edwin Vane edwin.vane at intel.com
Fri Jan 25 13:41:51 PST 2013


Remove the use of the 't' length modifier to avoid a gcc warning. Based
on usage, 32 bits of precision is good enough for printing a stack
offset for a stack trace.

http://llvm-reviews.chandlerc.com/D331

Files:
  lib/Support/Unix/Signals.inc

Index: lib/Support/Unix/Signals.inc
===================================================================
--- lib/Support/Unix/Signals.inc
+++ lib/Support/Unix/Signals.inc
@@ -295,7 +295,8 @@
       else           fputs(d, FD);
       free(d);
 
-      fprintf(FD, " + %tu",(char*)StackTrace[i]-(char*)dlinfo.dli_saddr);
+      fprintf(FD, " + %u",(unsigned)((char*)StackTrace[i]-
+                                     (char*)dlinfo.dli_saddr));
     }
     fputc('\n', FD);
   }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D331.1.patch
Type: text/x-patch
Size: 478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130125/49f4bbf6/attachment.bin>


More information about the llvm-commits mailing list