[PATCH] fix printf "%p" output on 64-bit platform

Atsushi Nemoto anemo at mba.ocn.ne.jp
Sat Jan 27 14:10:22 UTC 2007


On Fri, 26 Jan 2007 12:29:47 -0600, Roman Kononov <roman at xtremedatainc.com> wrote:
> In reference to http://www.uclibc.org/lists/uclibc/2006-November/016736.html
> 
> I confirm that the current printf("%p") (revision 17475) is broken for x86_64.
> The patch in the above link fixes it.
> 
> Nevertheless, I made another patch, which looks more portable in (contrived?)
> cases when sizeof(long)!=sizeof(void*).

Thanks!

First, your mailer still break your patch.  It seems your mailer
insert an additional space character on every line staring with a
space.  I have seen someone blame "format=flowed", but not sure what
to do.  Anyway, sending patches in attachment would be better since
Mike Frysinger told me to do so some time ago.

For the patch itself, I do not think we should care
"sizeof(long)!=sizeof(void *)" case.  I'm not sure the magic typedef
do not confuse any compiler, so I think the magic typedef check is not
needed at all.

Also, type_codes[1] in _vprintf.c should be changed to
PA_POINTER|PA_FLAG_PTR too, no?  (not tested yet)

---
Atsushi Nemoto



More information about the uClibc mailing list