Speaking of this, does anyone know a portable way to get printf to
handle off_t values when they may be larger that a long? Is there
none?
I normally write
off_t foo = ....;
printf("seek to %ld\n", (long) foo);
accepting that for long values on some platforms it will just be
wrong. Is there a better solution that's not gcc or glibc-specific?
>From what I've seen of the standards, there is no standard format
longer than %ld, but off_t can be longer than long.
I guess perhaps I could use autoconf to work out appropriate format
strings and typecasts:
#define OFF_T_PRINT_FORMAT "%lld"
#define OFF_T_PRINT_CAST (long long)
printf("seek to " OFF_T_PRINT_FORMAT, OFF_T_PRINT_CAST foo);
I don't care so much about this in rsync, but librsync trace and error
messages do this all the time, and it's bothered me that they might
give the wrong values.
--
Martin Pool, Human Resource
Linuxcare. Inc. +61 2 6262 8990
[EMAIL PROTECTED], http://linuxcare.com.au/
Linuxcare. Putting Open Source to work.