Subject: printf && (u)int_64t [c-question]
To: None <netbsd-help@netbsd.org>
From: Martin Weber <Ephaeton@gmx.net>
List: netbsd-help
Date: 11/07/2001 16:45:02
Uhm, not sure if that's the right forum, tell me if it isn't.

K, my problem was the following: I was playing with a tool I've
written which plays a bit with (l)stat. In its current shape it
simply prints all information returned by a stat call. My problem
is connected to off_t and int64_t which happen to be quads if I'm
not mistaken. How do you print those ? I mean, gcc -Wall complains
about wrong type of argument for a %ld conversion, and if I cast
it explicitely to long this is not guaranteed to not loose stuff
on certain platforms, right ? So what is the correct way to output
a (u)int64_t with printf ?

Uhm, bit of related: (struct stat).st_blocks has type int64_t,
someone mind enlightening me why it is not uint64_t ? Are there
files with -1 blocks ? If there are none, why is it not unsigned ?
Doesn'T this halve the maximal imaginable file size ?

Enough questions, tia, and flame me if I'm in the wrong forum ;)

Martin Weber