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:

  <http://gna.org/bugs/?16300>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to