In article danpop@mail.cern.ch (Dan Pop) writes: >First, basic C knowledge :-) > >Your conclusion is incorrect and it is based on broken code, which >invokes undefined behaviour, hence it cannot be used to prove anything >even if it happens to "work". > >The correct way to display pointer values is to use %p and to cast the >pointers to void *, because this is what %p expects. %lx expects an >unsigned long, not a pointer of whatever size. So, the correct fprintf >calls are: > > fprintf(stderr,"woof = 0x%p\n", (void *)woof); > fprintf(stderr,"block = 0x%p\n", (void *)block); ... ANSI X3J11/88-159 says on p. 135 of �4.9.6.1 (The fprintf function): " p The argument shall be a pointer to void. The value of the pointer is converted to a sequence of printable characters, in an implementation-defined manner. ^^^^^ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The only use defined by ANSI for a string fprintf'ed with %p is to fscanf it with %p during the same program execution. fprintf %p could encrypt a pointer value to a string using a one-time pad, and as long as fscanf %p was able to decrypt it, that would be a valid implementation. /AHM -- Alan Howard Martin AMartin@TLE.ENet.DEC.Com