6.2.6.1 General

Previous Table of Contents "New C Standard" commentary

569 The representations of all types are unspecified except as stated in this subclause.

570 Except for bit-fields, objects are composed of contiguous sequences of one or more bytes, the number, order, and encoding of which are either explicitly specified or implementation-defined.

571 Values stored in unsigned bit-fields and objects of type unsigned char shall be represented using a pure binary notation.40)

572 Values stored in non-bit-field objects of any other object type consist of n × CHAR_BIT bits, where n is the size of an object of that type, in bytes.

573 The value may be copied into an object of type unsigned char [n] (e.g., by memcpy);

574 the resulting set of bytes is called the object representation of the value.

575 Values stored in bit-fields consist of m bits, where m is the size specified for the bit-field.

576 The object representation is the set of m bits the bit-field comprises in the addressable storage unit holding it.

577 Two values (other than NaNs) with the same object representation compare equal, but values that compare equal may have different object representations.

578 Certain object representations need not represent a value of the object type.

579 If the stored value of an object has such a representation and is read by an lvalue expression that does not have character type, the behavior is undefined.

580 If such a representation is produced by a side effect that modifies all or any part of the object by an lvalue expression that does not have character type, the behavior is undefined.41)

581 Such a representation is called a trap representation.

582 40) A positional representation for integers that uses the binary digits 0 and 1, in which the values represented by successive bits are additive, begin with 1, and are multiplied by successive integral powers of 2, except perhaps the bit with the highest position.

583 (Adapted from the American National Dictionary for Information Processing Systems.)

584 A byte contains CHAR_BIT bits, and the values of type unsigned char range from 0 to 2CHAR_BIT-1.

585 41) Thus, an automatic variable can be initialized to a trap representation without causing undefined behavior, but the value of the variable cannot be used until a proper value is stored in it.

586 When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding bytes take unspecified values.42)

587 The values of padding bytes shall not affect whether the value of such an object is a trap representation. The value of a structure or union object is never a trap representation, even though the value of a member of a structure or union object may be a trap representation.

588 Those bits of a structure or union object that are in the same byte as a bit-field member, but are not part of that member, shall similarly not affect whether the value of such an object is a trap representation.

589 When a value is stored in a member of an object of union type, the bytes of the object representation that do not correspond to that member but do correspond to other members take unspecified values, but the value of the union object shall not thereby become a trap representation.

590 Where an operator is applied to a value that has more than one object representation, which object representation is used shall not affect the value of the result.43)

591 Where a value is stored in an object using a type that has more than one object representation for that value, it is unspecified which representation is used, but a trap representation shall not be generated.

592 Forward references: declarations (6.7), expressions (6.5), lvalues, arrays, and function designators (6.3.2.1).

Next

Created at: 2008-01-30 02:39:40 The text from WG14/N1256 is copyright © ISO