Re: [patch 1/1] dm: fix printk warnings about whether %lu/%Lu is right for sector_t

From: Paolo Giarrusso
Date: Fri Oct 08 2004 - 15:48:49 EST


On Friday 08 October 2004 22:11, Anton Altaparmakov wrote:
> On Fri, 8 Oct 2004, Andrew Morton wrote:
> > blaisorblade_spam@xxxxxxxx wrote:


> Actually %Ld is completely wrong. I know in the kernel it makes no
> difference but people see it in the kernel and then go off an use it in
> userspace and it generates junk output on at least some architectures.
Well, gcc does not complain, and the problem is not "kernel is special" or "on
some arch it's different". It's an alias for "ll" for both gcc and glibc; I
checked, in fact, the version below of info pages for glibc:

This is Edition 0.10, last updated 2001-07-06, of `The GNU C Library
Reference Manual', for Version 2.3.x of the GNU C Library.
(I guess the "last update" is botched).

> This is because %L means "long double (floating point)" not "long long
> integer" and when you stuff an integer into it it goes wrong (on some
> architectures)...
I think an all ones, or at least on i386.
> From the printf(3) man page:
Outdated.
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
-
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/