]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make "silly arg" message 64-bit clean.
authorNicholas Nethercote <njn@valgrind.org>
Tue, 23 Aug 2005 16:10:36 +0000 (16:10 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 23 Aug 2005 16:10:36 +0000 (16:10 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4476

memcheck/mac_malloc_wrappers.c

index de6d7e1508aff0f4f2816704db53418ceb8b2cb0..cd9a71dd043173fd21014a7804d148275ff9b9d1 100644 (file)
@@ -158,7 +158,15 @@ static Bool complain_about_silly_args(SizeT sizeB, Char* fn)
    // assuming here that the size asked for is not greater than 2^31 bytes
    // (for 32-bit platforms) or 2^63 bytes (for 64-bit platforms).
    if ((SSizeT)sizeB < 0) {
-      VG_(message)(Vg_UserMsg, "Warning: silly arg (%d) to %s()", sizeB, fn );
+#if VG_WORDSIZE == 4
+      VG_(message)(Vg_UserMsg, "Warning: silly arg (%d) to %s()",
+                   (Int)sizeB, fn );
+#elif VG_WORDSIZE == 8
+      VG_(message)(Vg_UserMsg, "Warning: silly arg (%lld) to %s()",
+                   (Long)sizeB, fn );
+#else
+#  error Unexpected word size
+#endif
       return True;
    }
    return False;
@@ -167,8 +175,15 @@ static Bool complain_about_silly_args(SizeT sizeB, Char* fn)
 static Bool complain_about_silly_args2(SizeT n, SizeT sizeB)
 {
    if ((SSizeT)n < 0 || (SSizeT)sizeB < 0) {
+#if VG_WORDSIZE == 4
       VG_(message)(Vg_UserMsg, "Warning: silly args (%d,%d) to calloc()",
-                   n, sizeB);
+                   (Int)n, (Int)sizeB);
+#elif VG_WORDSIZE == 8
+      VG_(message)(Vg_UserMsg, "Warning: silly args (%lld,%lld) to calloc()",
+                   (Long)n, (Long)sizeB);
+#else
+#  error Unexpected word size
+#endif
       return True;
    }
    return False;