From b19ed4c6a56ec93215ab567ba18ba61bf1cfbac8 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Mon, 2 Apr 2018 15:11:04 +0200 Subject: [PATCH] regressions/ck_pr: Cast -1 to intptr_t before casting it to void *. --- regressions/ck_pr/validate/ck_pr_load.c | 6 +++--- regressions/ck_pr/validate/ck_pr_store.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/regressions/ck_pr/validate/ck_pr_load.c b/regressions/ck_pr/validate/ck_pr_load.c index b07a38f..d3b8520 100644 --- a/regressions/ck_pr/validate/ck_pr_load.c +++ b/regressions/ck_pr/validate/ck_pr_load.c @@ -118,7 +118,7 @@ rg_width(int m) int main(void) { - void *ptr = (void *)-1; + void *ptr = (void *)(intptr_t)-1; common_srand((unsigned int)getpid()); @@ -145,8 +145,8 @@ main(void) printf("%" PRIx64 ":%" PRIx64 "\n", a[0], a[1]); #endif printf("ck_pr_load_ptr: "); - if (ck_pr_load_ptr(&ptr) != (void *)(-1)) - printf("Failed : %p != %p\n", ck_pr_load_ptr(&ptr), (void *)(-1)); + if (ck_pr_load_ptr(&ptr) != (void *)(intptr_t)(-1)) + printf("Failed : %p != %p\n", ck_pr_load_ptr(&ptr), (void *)(intptr_t)(-1)); else printf("SUCCESS\n"); diff --git a/regressions/ck_pr/validate/ck_pr_store.c b/regressions/ck_pr/validate/ck_pr_store.c index 07e969b..e012b22 100644 --- a/regressions/ck_pr/validate/ck_pr_store.c +++ b/regressions/ck_pr/validate/ck_pr_store.c @@ -148,9 +148,9 @@ main(void) CK_PR_STORE_B(8); #endif printf("ck_pr_store_ptr: "); - ck_pr_store_ptr(&ptr, (void *)-1); - if (ptr != (void *)(-1)) - printf("Failed : %p != %p\n", ptr, (void *)-1); + ck_pr_store_ptr(&ptr, (void *)(intptr_t)-1); + if (ptr != (void *)(intptr_t)(-1)) + printf("Failed : %p != %p\n", ptr, (void *)(intptr_t)-1); else printf("SUCCESS\n");