https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84814

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
the integral promotions (4.5) shall be performed on both operands

This means uint16_t is promoted to int first.

So:
if((curtime - LastTime) >= Request)

Is really:
if(((int)curtime - (int)LastTime) >= (int)Request)


In the second case the code is equivalent to:
if((int)(uint16_t)((int)curtime - (int)LastTime) >= (int)Request)

Reply via email to