From: Joe O. <jo...@re...> - 2002-04-14 13:43:02
|
%p truncates the pointer to the low 32-bits. Fix & regression test below: --- trio.c 7 Apr 2002 16:37:12 -0000 1.47 +++ trio.c 14 Apr 2002 13:36:27 -0000 @@ -1509,6 +1509,10 @@ break; case SPECIFIER_POINTER: + if (sizeof(void *) == sizeof(trio_ulonglong_t)) + flags |= FLAGS_QUAD; + else if (sizeof(void *) == sizeof(long)) + flags |= FLAGS_LONG; parameters[pos].type = FORMAT_POINTER; break; --- regression.c 7 Apr 2002 16:37:12 -0000 1.23 +++ regression.c 14 Apr 2002 13:36:28 -0000 @@ -218,9 +218,13 @@ /* Pointer */ nerrors += Verify(__FILE__, __LINE__, "Pointer (nil)", "Pointer %p", 0); - /* This may fail on 64 bit machines */ - nerrors += Verify(__FILE__, __LINE__, "Pointer 0x01234567", - "Pointer %p", 0x1234567); + if (sizeof(void *) == 4) { + nerrors += Verify(__FILE__, __LINE__, "Pointer 0x01234567", + "Pointer %p", 0x1234567); + } else if (sizeof(void *) == 8) { + nerrors += Verify(__FILE__, __LINE__, "Pointer 0x0123456789012345", + "Pointer %p", 0x123456789012345); + } /* Nil pointer */ nerrors += Verify(__FILE__, __LINE__, "Pointer (nil)", "Pointer %p", NULL); |