Re: printk and long long

From: vda
Date: Wed Feb 11 2004 - 09:07:08 EST


On Wednesday 11 February 2004 15:48, Maciej Zenczykowski wrote:
> > how about simply using a shift to output two regular longs, i.e.
> >
> > printk("%ld%ld",loff_t >> (sizeof(long) * 8), loff_t << sizeof(long) * 8
> > >> sizeof(long) * 8);
>
> I'd venture to guess you'd also have to cast the above to long.

Hey that will work only for %x, not %d.

BTW, man printf says:

The character L specifying that a following e, E, f, g, or G
conversion corresponds to a long double argument, or a following
d, i, o, u, x, or X conversion corresponds to a long long argument.
Note that long long is not specified in ANSI C and therefore
not portable to all architectures.
--
vda
-
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/