4 ms·
You are close, but a little off. Your first citation is correct - we have to perform the usual arithmetic conversions. In your second citation, though, you mi
by jjnoakes 7y ago
You are close, but a little off.
Your first citation is correct - we have to perform the usual arithmetic conversions.
In your second citation, though, you missed the very first paragraph in your picture:
> The integer promotions are performed on both operands, then the following rules apply:
(emphasis is mine).
Before you apply those rules you have to perform the "integer promotions"; they are defined in section 6.3.1.1 subsection 2 and they say, in part, that operands of rank smaller than int (which we have in this example) are converted to int first (which is what my original reply was pointing out).
Once both operands are converted to int, no more "usual arithmetic conversions" are needed, so the resulting operation is done on two ints, and the result has to be 0.
This is not implementation-defined.
(By the way your last citation is for extended integer types, which we are not dealing with here - we are dealing with the basic integer types here).