And a byte is not necessary 8 bits in length, even though that's been the standard for many decades.
Interesting to note that C refuses to standardize some operations (leaving them "implementation dependent" instead), because 1s-complement machines are still covered. Under/overflow and shift, for example.
I think you mean operations on signed integers (OK probably obvious from the "1s-complement", but just to make things clear). Overflow is fully defined with unsigned integers, and just rolls over (which is basically OP (mod 2^N) ).
The situation with signed integers is pretty annoying. Of course what it means is that if you want to write portable code, never make your signed integers "overflow".
I've seen a lot of code making assumptions about this (which happened to work with come compiler on some machine), and that can break beautifully on some other platform...
Though I forget if non-8-bit-byte or word machines share a similar historical mandate.
Yep. Quoting the standard, byte is defined like so:
byte
addressable unit of data storage large enough to hold any member of the basic character set of the execution environment
and:
character
bit representation that fits in a byte
The standard associates bytes and "characters", so this completely depends on the underlying "execution environment".
We had to wait until C99 to get fixed-size integers.
Note that this definition of integers as "large enough to hold at least xxx" is not specific to C. The same thing happens with many other "high-level" languages. Interestingly, Pascal and some derivatives cared to define a BYTE (8-bit) type outside of the "CHAR", whereas the typical INTEGER (and I think CHAR) would be treated as in C (with no fixed defined size).