diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2014-07-19 18:51:19 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2014-07-23 07:38:42 +0200 |
commit | 61b2b557951a88441a88e37bb0014e158cc8a14d (patch) | |
tree | 4747e70b63f5913cf8e86832473a398581e977e1 | |
parent | 606ba3cb75e0ffccf609003c7c45eb3479231396 (diff) | |
download | cmocka-61b2b557951a88441a88e37bb0014e158cc8a14d.tar.gz cmocka-61b2b557951a88441a88e37bb0014e158cc8a14d.tar.bz2 cmocka-61b2b557951a88441a88e37bb0014e158cc8a14d.zip |
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 <emil.l.velikov@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/cmocka.c | 2 |
1 files changed, 1 insertions, 1 deletions
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( |