Download raw body.
use size_t for loop indices to avoid signedness warnings
On Fri, 18 Dec 2020 17:04:10 +0100, Stefan Sperling wrote: > Macro question aside, do I understand correctly that casting sizeof(x) to > ssize_t is preferred over casting to an int? > > Where my patch uses (int)sizeof(msg) to compare to an int, it should do > (ssize_t)sizeof(msg) instead? > > I guess we'd otherwise risk truncation when the result of sizeof(x) exceeds > the size of an int? Or is there another problem? I generally cast to the signed equivalent of the type in question to avoid truncation. Realistically, this is a non-issue with sizeof(foo) since you are not going to have data types with a size larger than INT_MAX. So I don't think it really matters in practice. - todd
use size_t for loop indices to avoid signedness warnings