J
Jordan Abel
Hmm.. But what about a machine with 9 bit bytes where CHAR_BIT is 8
(the C compiler simply ignores the most significant bit)? I believe
that the standard doesn't allow padding bits in char but I think in
this case the most significant bit is not a padding bit, it is simply
ignored by the compiler author. In this case a string of chars will
still be contiguous from the point of view of C but you won't be able
to ever find out the size of the machine byte from C.
If it's "ignored", it has to be consistently ignored - i.e. it is a
padding bit in both [or more] bytes in an int, and in all [at least]
four bytes in a long. And it can't be a "dangerous" padding bit [i.e. if
assignments to it as unsigned char sets or clears it, having it
set/clear can't be a trap representation of other types or vice versa].
I'm not so sure about how conformant is such an implementation. Any
standard experts here think it's valid?
If it's _impossible_ to prove in software that such a bit exists, I
suppose the implementation could be valid. I suppose one could say that
the ECC bit is a real-world example.