[PATCH] Avoid pointer arithmetic on void* in test/integration/rallocx.c

Mike Hommey mh+jemalloc at glandium.org
Wed May 21 02:13:21 PDT 2014


From: Mike Hommey <mh at glandium.org>

---
 test/integration/rallocx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/integration/rallocx.c b/test/integration/rallocx.c
index ee21aed..7acb211 100644
--- a/test/integration/rallocx.c
+++ b/test/integration/rallocx.c
@@ -95,7 +95,7 @@ TEST_BEGIN(test_zero)
 				    "Expected zeroed memory");
 			}
 			if (psz != qsz) {
-				memset(q+psz, FILL_BYTE, qsz-psz);
+				memset((char *)q+psz, FILL_BYTE, qsz-psz);
 				psz = qsz;
 			}
 			p = q;
@@ -159,8 +159,8 @@ TEST_BEGIN(test_lg_align_and_zero)
 		} else {
 			assert_false(validate_fill(q, 0, 0, MAX_VALIDATE),
 			    "Expected zeroed memory");
-			assert_false(validate_fill(q+sz-MAX_VALIDATE, 0, 0,
-			    MAX_VALIDATE), "Expected zeroed memory");
+			assert_false(validate_fill((char *)q+sz-MAX_VALIDATE,
+                            0, 0, MAX_VALIDATE), "Expected zeroed memory");
 		}
 		p = q;
 	}
-- 
2.0.0.rc2



More information about the jemalloc-discuss mailing list