Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: xsrc/external/mit/xterm/dist



16.05.2021 10:29:48 Robert Elz <kre%munnari.OZ.AU@localhost>:
> 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.


Home | Main Index | Thread Index | Old Index