Date:        Sun, 16 May 2021 16:32:55 +1000
    From:        Simon Burge <sim...@netbsd.org>
    Message-ID:  <20210516063255.13f704e...@thoreau.thistledown.com.au>

  | Roland Illig wrote:
  | > therefore I did it this way, for consistency.
  |
  | Good reason :)

Actually, it isn't.  Consistency is good,
but correctness is better.  Both is better
still.  It is possible that unsigned long
is 32 bits, and size_t is 64, in which case
casting to unsigned long risks truncating
the value.  That might not be possible in
the cases in question, but why risk it?
Always use the z modifier to print size_t.

kre

Reply via email to