Re: [PATCH] x86: small unifications of address printing
- From: "Vegard Nossum" <vegard.nossum@xxxxxxxxx>
- Date: Tue, 1 Jul 2008 20:46:24 +0200
On Tue, Jul 1, 2008 at 8:29 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
Vegard Nossum <vegard.nossum@xxxxxxxxx> writes:
'man 3 printf' tells me that %p should be printed as if by %#x, but
this is not true for the kernel, which does not use the '0x' prefix
for the %p conversion specifier.
Problem is that %p will not pad to 8/16 digits. Addresses are traditionally
padded.
Yes, it will, and correctly too:
case 'p':
flags |= SMALL;
if (field_width == -1) {
field_width = 2*sizeof(void *);
flags |= ZEROPAD;
}
Or did I read this code wrong? field_width is initialized to -1 by
default unless overridden. The SMALL flag means lowercase hexadecimal
digits.
Vegard
--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] x86: small unifications of address printing
- From: Andi Kleen
- Re: [PATCH] x86: small unifications of address printing
- References:
- [PATCH] x86: small unifications of address printing
- From: Vegard Nossum
- Re: [PATCH] x86: small unifications of address printing
- From: Andi Kleen
- [PATCH] x86: small unifications of address printing
- Prev by Date: Re: Intel DG965WH / Case 745-44-22 (slow bios/upgrade) [UPDATE] / Intel, status of HECI support patch for the kernel?
- Next by Date: [GIT PULL] Userlib integration patches
- Previous by thread: Re: [PATCH] x86: small unifications of address printing
- Next by thread: Re: [PATCH] x86: small unifications of address printing
- Index(es):
Relevant Pages
|
Loading