Microchip Technology SW006021-1N 用户手册
Implementation-Defined Behavior
2012 Microchip Technology Inc.
DS52053B-page 483
C.9
STRUCTURES, UNIONS, ENUMERATIONS, AND BIT-FIELDS (G.3.9)
C.9.1
A member of a union object is accessed using a member of a
different type (6.3.2.3)
different type (6.3.2.3)
The value stored in the union member is accessed and interpreted according to the
type of the member by which it is accessed.
type of the member by which it is accessed.
C.9.2
The padding and alignment of members of structures (6.5.2.1)
No padding or alignment is imposed on structure members.
C.9.3
Whether a plain int bit-field is treated as a signed int bit-field or
as an unsigned int bit-field (6.5.2.1)
as an unsigned int bit-field (6.5.2.1)
It is treated as an unsigned int. Signed bit-fields are not supported.
C.9.4
The order of allocation of bit-fields within an int (6.5.2.1)
The first bit-field defined in a structure is allocated the LSb position in the storage unit.
Subsequent bit-fields are allocated higher-order bits.
Subsequent bit-fields are allocated higher-order bits.
C.9.5
Whether a bit-field can straddle a storage-unit boundary
(6.5.2.1)
(6.5.2.1)
A bit-field may not straddle a storage unit. Any bit-field that would straddle a storage
unit will be allocated to the LSb position in a new storage unit.
unit will be allocated to the LSb position in a new storage unit.
C.9.6
The integer type chosen to represent the values of an
enumeration type (6.5.2.2)
enumeration type (6.5.2.2)
The type chosen to represent an enumerated type depends on the enumerated values.
A signed type is chosen if any value is negative; unsigned otherwise. If a char type is
sufficient to hold the range of values, then this is chosen; otherwise, an int type is cho-
sen. Enumerated values must fit within an int type and will be truncated if this is not
the case.
A signed type is chosen if any value is negative; unsigned otherwise. If a char type is
sufficient to hold the range of values, then this is chosen; otherwise, an int type is cho-
sen. Enumerated values must fit within an int type and will be truncated if this is not
the case.
C.10 QUALIFIERS (G.3.10)
C.10.1
What constitutes an access to an object that has
volatile-qualified type (6.5.5.3)
volatile-qualified type (6.5.5.3)
Each reference to the name of a volatile-qualified object constitutes one access to
the object.
the object.
C.11
DECLARATORS (G.3.11)
C.11.1
The maximum number of declarators that may modify an
arithmetic, structure, or union type (6.5.4)
arithmetic, structure, or union type (6.5.4)
No limit is imposed by the compiler.
C.12 STATEMENTS (G.3.12)
C.12.1
The maximum number of case values in a switch statement
(6.6.4.2)
(6.6.4.2)
There is no practical limit to the number of case labels inside a switch statement.