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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You shouldn't read random blogs, but the standard of the language you are
writing in.
E.g. in n3797.pdf it is in [expr]/10:
"Otherwise, the integral promotions (4.5) shall be performed on both operands.
Then the following rules shall be applied to the promoted operands:
— If both operands have the same type, no further conversion is needed.
— Otherwise, if both operands have signed integer types or both have unsigned
integer types, the operand with the type of lesser integer conversion rank
shall be converted to the type of the operand with greater rank.
— Otherwise, if the operand that has unsigned integer type has rank greater
than or equal to the rank of the type of the other operand, the operand with
signed integer type shall be converted to the type of the operand with unsigned
integer type.
— Otherwise, if the type of the operand with signed integer type can represent
all of the values of the type of the operand with unsigned integer type, the
operand with unsigned integer type shall be converted to the type of the
operand with signed integer type.
— Otherwise, both operands shall be converted to the unsigned integer type
corresponding to the type of the operand with signed integer type.

Reply via email to