>>>> "JJ" == Jerry James
<james(a)xemacs.org> writes:
JJ> pointer can be returned. So the cast to
(void *) in XPNTR is
JJ> superfluous.
Perhaps, but casts to void* might have the effect of inhibiting
compiler aliasing optimizations, and shouldn't hurt if re-cast.
JJ> But there, the format strings should be using %p instead of
JJ> %lx, in which case the casts to (long) and (unsigned long) would be
On some platforms printf implementation of "%p" includes "0x", on
others leaves it out. "%lx" is a more predictable way to get
consistent pointer printing.
It's true that "%lx" has a builtin non-portable assumption, namely
that a pointer fits into a long - but that's pervasive in the source
code, and true of all current machines. And it looks like we're
moving towards a LP64 world, so this assumption in the source code
will continue to be true for at least another decade.
JJ> unnecessary anyway. The (unsigned long) cast in internal_object_printer
JJ> should be (long), anyway, to match the format string.
Perhaps the format should be "%ulx", if that is legal. In practice I
don't think it matters.
Why have I been able to use gcc 2.95.3 to compile xemacs for years on
Suns without any problem? (of course, avoiding -mcpu=ultrasparc)