From 4d2f01b84dfd437cba9d73cf9068d22da435278f Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Fri, 9 Mar 2012 15:14:00 -0700 Subject: [PATCH] regressions: Do not break strict aliasing rules in ck_pr validation tests. Signed-off-by: Samy Al Bahra --- regressions/ck_pr/validate/ck_pr_add.c | 4 ++-- regressions/ck_pr/validate/ck_pr_and.c | 2 +- regressions/ck_pr/validate/ck_pr_cas.c | 2 +- regressions/ck_pr/validate/ck_pr_dec.c | 2 +- regressions/ck_pr/validate/ck_pr_faa.c | 4 ++-- regressions/ck_pr/validate/ck_pr_fas.c | 2 +- regressions/ck_pr/validate/ck_pr_inc.c | 2 +- regressions/ck_pr/validate/ck_pr_or.c | 2 +- regressions/ck_pr/validate/ck_pr_store.c | 2 +- regressions/ck_pr/validate/ck_pr_sub.c | 4 ++-- regressions/ck_pr/validate/ck_pr_xor.c | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/regressions/ck_pr/validate/ck_pr_add.c b/regressions/ck_pr/validate/ck_pr_add.c index c8b1f4a..5f2ce87 100644 --- a/regressions/ck_pr/validate/ck_pr_add.c +++ b/regressions/ck_pr/validate/ck_pr_add.c @@ -67,13 +67,13 @@ #define CK_PR_ADD_W(m, w) \ { \ uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \ - ck_pr_add_##w((uint##w##_t *)&t, 1); \ + ck_pr_add_##w((uint##w##_t *)(void *)&t, 1); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\ exit(EXIT_FAILURE); \ } \ t = 0, r = (uint##m##_t)(uint##w##_t)-1; \ - ck_pr_add_##w((uint##w##_t *)&t, -1); \ + ck_pr_add_##w((uint##w##_t *)(void *)&t, -1); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_and.c b/regressions/ck_pr/validate/ck_pr_and.c index 68fbb45..e525db9 100644 --- a/regressions/ck_pr/validate/ck_pr_and.c +++ b/regressions/ck_pr/validate/ck_pr_and.c @@ -69,7 +69,7 @@ #define CK_PR_AND_W(m, w) \ { \ uint##m##_t t = -1; \ - ck_pr_and_##w((uint##w##_t *)&t, 0); \ + ck_pr_and_##w((uint##w##_t *)(void *)&t, 0); \ if (t != BM(m, w)) { \ printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_cas.c b/regressions/ck_pr/validate/ck_pr_cas.c index e67c796..fb6a5bc 100644 --- a/regressions/ck_pr/validate/ck_pr_cas.c +++ b/regressions/ck_pr/validate/ck_pr_cas.c @@ -72,7 +72,7 @@ #define CK_PR_CAS_W(m, w) \ { \ uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \ - ck_pr_cas_##w((uint##w##_t *)&t, (uint##w##_t)t, 0); \ + ck_pr_cas_##w((uint##w##_t *)(void *)&t, (uint##w##_t)t, 0); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", \ (uint##m##_t)t, (uint##m##_t)r); \ diff --git a/regressions/ck_pr/validate/ck_pr_dec.c b/regressions/ck_pr/validate/ck_pr_dec.c index ee7c44c..b4e43bd 100644 --- a/regressions/ck_pr/validate/ck_pr_dec.c +++ b/regressions/ck_pr/validate/ck_pr_dec.c @@ -65,7 +65,7 @@ #define CK_PR_DEC_W(m, w) \ { \ uint##m##_t t = 0, r = (uint##w##_t)-1; \ - ck_pr_dec_##w((uint##w##_t *)&t); \ + ck_pr_dec_##w((uint##w##_t *)(void *)&t); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_faa.c b/regressions/ck_pr/validate/ck_pr_faa.c index c2df67e..efcb5bd 100644 --- a/regressions/ck_pr/validate/ck_pr_faa.c +++ b/regressions/ck_pr/validate/ck_pr_faa.c @@ -68,13 +68,13 @@ #define CK_PR_FAA_W(m, w) \ { \ uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \ - ck_pr_faa_##w((uint##w##_t *)&t, 1); \ + ck_pr_faa_##w((uint##w##_t *)(void *)&t, 1); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\ exit(EXIT_FAILURE); \ } \ t = 0, r = (uint##m##_t)(uint##w##_t)-1; \ - ck_pr_faa_##w((uint##w##_t *)&t, -1); \ + ck_pr_faa_##w((uint##w##_t *)(void *)&t, -1); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_fas.c b/regressions/ck_pr/validate/ck_pr_fas.c index 3684697..4e9fca6 100644 --- a/regressions/ck_pr/validate/ck_pr_fas.c +++ b/regressions/ck_pr/validate/ck_pr_fas.c @@ -70,7 +70,7 @@ #define CK_PR_FAS_W(m, w) \ { \ uint##m##_t t = 0; \ - ck_pr_fas_##w((uint##w##_t *)&t, -1); \ + ck_pr_fas_##w((uint##w##_t *)(void *)&t, -1); \ if (t != BM(m, w)) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_inc.c b/regressions/ck_pr/validate/ck_pr_inc.c index 60296f8..d633465 100644 --- a/regressions/ck_pr/validate/ck_pr_inc.c +++ b/regressions/ck_pr/validate/ck_pr_inc.c @@ -65,7 +65,7 @@ #define CK_PR_INC_W(m, w) \ { \ uint##m##_t t = -1, r = -1 & ~(uint##m##_t)(uint##w##_t)-1; \ - ck_pr_inc_##w((uint##w##_t *)&t); \ + ck_pr_inc_##w((uint##w##_t *)(void *)&t); \ if (t != r) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r);\ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_or.c b/regressions/ck_pr/validate/ck_pr_or.c index 8eb479c..c0b25ef 100644 --- a/regressions/ck_pr/validate/ck_pr_or.c +++ b/regressions/ck_pr/validate/ck_pr_or.c @@ -69,7 +69,7 @@ #define CK_PR_OR_W(m, w) \ { \ uint##m##_t t = 0; \ - ck_pr_or_##w((uint##w##_t *)&t, -1); \ + ck_pr_or_##w((uint##w##_t *)(void *)&t, -1); \ if (t != BM(m, w)) { \ printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_store.c b/regressions/ck_pr/validate/ck_pr_store.c index cff08c4..5efb4d2 100644 --- a/regressions/ck_pr/validate/ck_pr_store.c +++ b/regressions/ck_pr/validate/ck_pr_store.c @@ -65,7 +65,7 @@ { \ uint##m##_t f = 0; \ uint##w##_t j = (uint##w##_t)-1; \ - ck_pr_store_##w((uint##w##_t *)&f, j); \ + ck_pr_store_##w((uint##w##_t *)(void *)&f, j); \ if (f != j) { \ printf("FAIL [%#" PRIx##m " != %#" PRIx##w "]\n", f, j);\ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_sub.c b/regressions/ck_pr/validate/ck_pr_sub.c index 3491b9b..2cd316e 100644 --- a/regressions/ck_pr/validate/ck_pr_sub.c +++ b/regressions/ck_pr/validate/ck_pr_sub.c @@ -67,13 +67,13 @@ #define CK_PR_SUB_W(m, w) \ { \ uint##m##_t t = 0, r = (uint##m##_t)(uint##w##_t)-1; \ - ck_pr_sub_##w((uint##w##_t *)&t, 1); \ + ck_pr_sub_##w((uint##w##_t *)(void *)&t, 1); \ if (t != r) { \ printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, r); \ exit(EXIT_FAILURE); \ } \ t = 0; \ - ck_pr_sub_##w((uint##w##_t *)&t, -1); \ + ck_pr_sub_##w((uint##w##_t *)(void *)&t, -1); \ if (t != 1) { \ printf(" FAIL [%#" PRIx##m " != 1]\n", t); \ exit(EXIT_FAILURE); \ diff --git a/regressions/ck_pr/validate/ck_pr_xor.c b/regressions/ck_pr/validate/ck_pr_xor.c index 937a0d9..6c88c39 100644 --- a/regressions/ck_pr/validate/ck_pr_xor.c +++ b/regressions/ck_pr/validate/ck_pr_xor.c @@ -69,7 +69,7 @@ #define CK_PR_XOR_W(m, w) \ { \ uint##m##_t t = -1; \ - ck_pr_xor_##w((uint##w##_t *)&t, -1); \ + ck_pr_xor_##w((uint##w##_t *)(void *)&t, -1); \ if (t != BM(m, w)) { \ printf(" FAIL [%#" PRIx##m " != %#" PRIx##m "]\n", t, BM(m, w)); \ exit(EXIT_FAILURE); \