Constant Expressions
Constant expressions may never contain (except as an operand to the sizeof operator):
- Assignment operators
- Increment or decrement operators
- Comma operators
- Function calls
Integral constant expressions
... are used in case expressions, to specify array bounds, to specify the size of a bit-field and as enumerator constants.
They may contain:
- Integral constants
- Enum constants
- Character constants
- sizeof expressions
- Floating constants cast to an integer type
... but may not contain (except as an argument to the sizeof operator):
- Arrays
- * operator
- & operator
- Structure member operations
Constant expressions in #if and #elif statements
... are integral constant expressions, but may not contain:
- sizeof expressions
- enumeration constants
- casts
Initializer constant expressions
... may contain any integer constant expression but can also include:
- Any type of constant
- & applied to external or static objects
- & applied to external or static arrays subscripted with a constant expression
- & applied implicitly by including a function name or an unsubscripted array name.
Index