From: Eric Pouech eric.pouech@gmail.com
GCC 12 complains with: wine/dlls/msvcrt/tests/cpp.c: In function 'test_rtti': wine/dlls/msvcrt/tests/cpp.c:1036:45: warning: array subscript 2 is outside array bounds of 'void[4]' [-Warray-bounds] 1036 | ok (casted == (char*)&child_class_sig0+8, "failed cast to simple_class (%p %p)\n", casted, &child_class_sig0); | ~~~~~~~~~~~~~~~~~~~~~~~~^~
As we're only testing the addresses and not the underlying objects, use uintptr_t instead of pointers.
Signed-off-by: Eric Pouech eric.pouech@gmail.com --- dlls/msvcrt/tests/cpp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index b2b6a1909b7..ada10060598 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -1033,7 +1033,7 @@ static void test_rtti(void) casted = p__RTDynamicCast(&child_class_sig0, 0, NULL, simple_class_sig0_rtti.type_info, 0); if(casted) { - ok (casted == (char*)&child_class_sig0+8, "failed cast to simple_class (%p %p)\n", casted, &child_class_sig0); + ok (casted == (char*)((uintptr_t)&child_class_sig0+8), "failed cast to simple_class (%p %p)\n", casted, &child_class_sig0); }
casted = p__RTDynamicCast(&child_class_sig0, 0, &child_class_sig0_rtti.type_info[0], &child_class_sig0_rtti.type_info[1], 0); @@ -1059,7 +1059,7 @@ static void test_rtti(void) casted = p__RTDynamicCast(&child_class, 0, NULL, simple_class_rtti.type_info, 0); if(casted) { - ok (casted == (char*)&child_class+8, "failed cast to simple_class (%p %p)\n", casted, &child_class); + ok (casted == (char*)((uintptr_t)&child_class+8), "failed cast to simple_class (%p %p)\n", casted, &child_class); }
casted = p__RTDynamicCast(&child_class, 0, &child_class_rtti.type_info[0], &child_class_rtti.type_info[1], 0);