Re: GCC 4.1 now the default GCC version for etch
On 6/19/06, Bastian Blank <email@example.com> wrote:
> Would it be safe to assume that a size_t can always be cast losslessly
> to an unsigned long (and then printed with %lu), or are there systems
> on which only an unsigned long long will do?
unsigned long is not sufficient.
OTOH, you could weigh up the chance that the number you're going to
output is greater than 2^32. If the chance is small, you cast it to
long and print using %lu. No chance of compiler errors, the display
will just look odd if you do try to print a larger number.
Martijn van Oosterhout <firstname.lastname@example.org> http://svana.org/kleptog/