From 61b2b557951a88441a88e37bb0014e158cc8a14d Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sat, 19 Jul 2014 18:51:19 +0100 Subject: [PATCH] cmocka: use %p to printf a pointer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Allegedly some versions of MSVC do not prefix the address with 0x whenever %p is used, while gcc (mingw-w64) always do. There is no clear way around this without providing a custom define, which currently is an overkill imho, as there is only one use-case. Silences the following warning when building with mingw-w64 cmocka/src/cmocka.c:1636:25: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘PVOID’ [-Wformat=] Signed-off-by: Emil Velikov Reviewed-by: Andreas Schneider --- src/cmocka.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmocka.c b/src/cmocka.c index ee9d5a9..1857277 100644 --- a/src/cmocka.c +++ b/src/cmocka.c @@ -1624,7 +1624,7 @@ static LONG WINAPI exception_filter(EXCEPTION_POINTERS *exception_pointers) { if (code == code_info->code) { static int shown_debug_message = 0; fflush(stdout); - print_error("%s occurred at 0x%08x.\n", code_info->description, + print_error("%s occurred at %#p.\n", code_info->description, exception_record->ExceptionAddress); if (!shown_debug_message) { print_error( -- 2.7.4