[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19f34abd0807011212w5e95f58aw998c74014f1d6632@mail.gmail.com>
Date: Tue, 1 Jul 2008 21:12:26 +0200
From: "Vegard Nossum" <vegard.nossum@...il.com>
To: "Andi Kleen" <andi@...stfloor.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: small unifications of address printing
On Tue, Jul 1, 2008 at 8:58 PM, Andi Kleen <andi@...stfloor.org> wrote:
>
>> 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.
>
> You're right. The kernel differs from user space/traditional behaviour
> in this regard.
...in this regard _too_ ;-)
I just ran a short test with glibc, and I'm surprised to see that this
implementation is not zero-padding the number.
The C99 standard has this to say:
"The argument shall be a pointer to void. The value of the pointer is
converted to a sequence of printing characters, in an implementation-defined
manner."
so I suppose it's quite alright after all.
Thanks for looking.
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists