diff options
author | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2007-11-09 11:33:02 +0000 |
---|---|---|
committer | sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2007-11-09 11:33:02 +0000 |
commit | 22faf7120ce48f1946caa68b01f4b8e450e1d06c (patch) | |
tree | 02b17a9f561df4d5414fe6d23262c63804dc500d | |
parent | eb0d332b3911dd71210c3478c226d2f4aede8758 (diff) |
Don't print warnings about silly args to malloc/calloc in XML mode.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7111 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r-- | memcheck/mc_malloc_wrappers.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/memcheck/mc_malloc_wrappers.c b/memcheck/mc_malloc_wrappers.c index 57b6b545..7ed5dffe 100644 --- a/memcheck/mc_malloc_wrappers.c +++ b/memcheck/mc_malloc_wrappers.c @@ -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; |