On Fri, Aug 03, 2018 at 18:08:24 +0300, Valery Ushakov wrote: > On Fri, Aug 03, 2018 at 15:54:24 +0200, Martin Husemann wrote: > > > On Fri, Aug 03, 2018 at 08:28:55PM +0700, Robert Elz wrote: > > > Where is the signed arithmetic that was supposedly a probem? > > > > Ah, stupid C integer promotion rules. uint16_t is promoted to int > > here, not unsigned int or size_t. > > Hmm, i don't think that's true.
Nah, you are right. "THEN" is the important word here. But as it transpired in another branch of this thread the problem was something entirely different... > 126.96.36.199 Usual arithmetic conversions > > ... > Otherwise, the integer promotions are performed on both > operands. Then the following rules are applied to the > promoted operands: -uwe