Follow-up Comment #6, bug #16300 (project freeciv):

This seems to be a FAQ on comp.lang.c... the consensus there seems to be that
casting to (unsigned long), as file #9564 does, is OK for C90 implementations,
since size_t is guaranteed to fit in that. That's not true for C99, but there
you can use the "%zu" format specifier (which is specifically for size_t).

However, relying on %zu puts us at the mercy of the system's printf. Looking
at this instance I don't think the risk of a cast to unsigned long losing
information is worth worrying about (it's just an unlikely diagnostic
message), so the cast seems like the best (most portable) solution.


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to