From: Emil Velikov Date: Sat, 19 Jul 2014 17:51:19 +0000 (+0100) Subject: cmocka: use %p to printf a pointer X-Git-Tag: cmocka-1.1.1~131 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61b2b557951a88441a88e37bb0014e158cc8a14d;p=platform%2Fupstream%2Fcmocka.git cmocka: use %p to printf a pointer 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 --- 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(