From: Hrvoje Niksic

> The code only uses that for printing the pointer's value (only used
> for debugging), and even so it carefully casts the pointer to unsigned
> long, to avoid a mismatch between pointer size and %lx.

   And this still assumes that "unsigned long" is big enough to hold a
pointer, which may not be true:

alp $ run SIZ_P64.EXE
 char = 1, int = 4, long = 4, long long = 8, void* = 8.

> The only trouble will be misprinted pointers.

   As I recall, I did not say that it was not very portable code _and_
that it was important, only that it was not very portable code.

   Correctly formatting a pointer (or off_t) value which may be
different sizes on different systems (or with different build options)
is harder than it should be.  I've previously mentioned the Info-ZIP
code which does a better job, but it does have more complexity and
conditionality.  Everything's complicated.

------------------------------------------------------------------------

   Steven M. Schweda               (+1) 651-699-9818
   382 South Warwick Street        [EMAIL PROTECTED]
   Saint Paul  MN  55105-2547

Reply via email to