[llvm] r244995 - Fix -Wformat warnings in ExceptionDemo

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 17:31:49 PDT 2015


Author: dblaikie
Date: Thu Aug 13 19:31:49 2015
New Revision: 244995

URL: http://llvm.org/viewvc/llvm-project?rev=244995&view=rev
Log:
Fix -Wformat warnings in ExceptionDemo

Modified:
    llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp

Modified: llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp?rev=244995&r1=244994&r2=244995&view=diff
==============================================================================
--- llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp (original)
+++ llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp Thu Aug 13 19:31:49 2015
@@ -77,6 +77,7 @@
 #include <sstream>
 #include <stdexcept>
 
+#include <inttypes.h>
 
 #ifndef USE_GLOBAL_STR_CONSTS
 #define USE_GLOBAL_STR_CONSTS true
@@ -569,8 +570,8 @@ static bool handleActionValue(int64_t *r
   fprintf(stderr,
           "handleActionValue(...): exceptionObject = <%p>, "
           "excp = <%p>.\n",
-          exceptionObject,
-          excp);
+          (void*)exceptionObject,
+          (void*)excp);
 #endif
 
   const uint8_t *actionPos = (uint8_t*) actionEntry,
@@ -588,8 +589,8 @@ static bool handleActionValue(int64_t *r
 
 #ifdef DEBUG
     fprintf(stderr,
-            "handleActionValue(...):typeOffset: <%lld>, "
-            "actionOffset: <%lld>.\n",
+            "handleActionValue(...):typeOffset: <%" PRIi64 ">, "
+            "actionOffset: <%" PRIi64 ">.\n",
             typeOffset,
             actionOffset);
 #endif
@@ -848,7 +849,7 @@ _Unwind_Reason_Code ourPersonality(int v
 #ifdef DEBUG
   fprintf(stderr,
           "ourPersonality(...):lsda = <%p>.\n",
-          lsda);
+          (void*)lsda);
 #endif
 
   // The real work of the personality function is captured here
@@ -1694,7 +1695,7 @@ static void createStandardUtilityFunctio
 #ifdef DEBUG
   fprintf(stderr,
           "createStandardUtilityFunctions(...):ourBaseFromUnwindOffset "
-          "= %lld, sizeof(struct OurBaseException_t) - "
+          "= %" PRIi64 ", sizeof(struct OurBaseException_t) - "
           "sizeof(struct _Unwind_Exception) = %lu.\n",
           ourBaseFromUnwindOffset,
           sizeof(struct OurBaseException_t) -




More information about the llvm-commits mailing list