]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't print warnings about silly args to malloc/calloc in XML mode.
authorJulian Seward <jseward@acm.org>
Fri, 9 Nov 2007 11:33:02 +0000 (11:33 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 9 Nov 2007 11:33:02 +0000 (11:33 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7111

memcheck/mc_malloc_wrappers.c

index 57b6b545a927b62eba921e4389adb82fec8109c6..7ed5dffecea63c40792cd81d1c967375bf25b9ca 100644 (file)
@@ -153,8 +153,9 @@ 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 (%ld) to %s()",
-                   (SSizeT)sizeB, fn );
+      if (!VG_(clo_xml)) 
+         VG_(message)(Vg_UserMsg, "Warning: silly arg (%ld) to %s()",
+                      (SSizeT)sizeB, fn );
       return True;
    }
    return False;
@@ -163,8 +164,10 @@ 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) {
-      VG_(message)(Vg_UserMsg, "Warning: silly args (%ld,%ld) to calloc()",
-                   (SSizeT)n, (SSizeT)sizeB);
+      if (!VG_(clo_xml))
+         VG_(message)(Vg_UserMsg,
+                      "Warning: silly args (%ld,%ld) to calloc()",
+                      (SSizeT)n, (SSizeT)sizeB);
       return True;
    }
    return False;