Jack Klein wrote:
On Wed, 15 Oct 2003 11:49:53 -0400, Eric Sosman <Er*********@su n.com>
wrote in comp.lang.c:
What *does* depend on the Standard version is whether
all bits zero is the same as value zero. In C89/90, an
`int' with all bits zero has the value zero. [...]
Chapter and verse, please, that C90 guaranteed that all bits 0 is a
valid representation of the value 0 for _ANY_ type.
Well, I might be wrong (it's happened before, and will
happen again). The reasoning goes like this: C90 requires
a "pure binary numeration system" for integer types, and
makes no mention of the possibility of non-value bits. If
there are no padding bits, all bits zero must be a valid
representation of an `int' zero.
The weak spot in the argument, of course, is the step
from "C90 doesn't mention padding bits" to the conclusion
"padding bits do not exist." It's logically unsound, I
readily admit. But C90 also omits any mention of behavior
that might result from messing with the representation of
an `int', and C90 also specifically allows a `char' with
all bits zero, so it seems likely -- not conclusive, but
likely -- that C90 doesn't permit padding bits.
By way of analogy (another fallacious, but suggestive
approach), consider that C99 makes no mention of radioactive
bits, or of any behavior that might result from using an
`int' containing one or more radioactive bits. It seems
reasonable to conclude that C99 doesn't permit radioactive
bits, even though Cnext might introduce them.
--
Er*********@sun .com