The C standard explains this quite clearly (Β§6.5.6 Additive operators):
If both operands are of arithmetic type, ordinary arithmetic conversions are performed .
(Β§6.3.1.8 Ordinary arithmetic conversions):
... in both operands, whole promotions are performed.
(Β§6.3.1.1 Boolean, symbols and integers):
If int can represent all values ββof the original type, the value is converted to an int value; ... They are called whole shares. All other types are not affected by whole promotions.
Since int can represent all uint16_t values ββon your platform, a and b converted to int before subtraction. The result is of type int and passed to printf as int . You specified the %u formatter with an int argument; strictly speaking, this causes undefined behavior, but on your platform, the int argument is interpreted as its two-component representation, and it prints.
source share