16.05.2021 10:29:48 Robert Elz <k...@munnari.oz.au>: > 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.
My second reason for doing the cast instead of the simpler %zu was that the xterm code looks compatible to C90, and I didn't want to destroy this property by using %zu, which has only been added in C99.