Subject: Bug#3825: %p either misbehaves or misdocumented

From: Richard Kettlewell <[email-masked]>
Date: Wed, 17 Jul 96 23:09:49 +0100 (BST)

Package: libc5
Version: 5.2.18-9

    richard@sfere:junk$ cat t.c
    #include <stdio.h>

    int main(void)
    {
	printf("%p\n", NULL);
	return 0;
    }
    richard@sfere:junk$ cc -o t t.c
    richard@sfere:junk$ ./t
    (nil)
    richard@sfere:junk$ 

But according to the printf(3) man page:

       p      The ``void *'' pointer argument is printed in  hex-
              adecimal (as if by %#x or %#lx).

``(nil)'' doesn't look very hexadecimal to me.  I think it ought to
print ``0x0''.

-- 
Richard Kettlewell   [email-masked]   [email-masked]
                             http://www.elmail.co.uk/staff/richard/

---

From: Ian Jackson <[email-masked]>
Date: Fri, 19 Jul 96 22:17 BST

Richard Kettlewell writes ("Bug#3825: %p either misbehaves or misdocumented"):
...
> ``(nil)'' doesn't look very hexadecimal to me.  I think it ought to

Hmm.  On some architectures null pointers are not all-bits-zero, and
it's not inconceivable that the GNU libc and Linux will run on them.

Surely `(nil)' is better ?  The documentation ought to be changed if
this is intentional.

Ian.