A composite expression is defined as a non-constant expression which is the direct result of a composite operator:
| Multiplicative | * / % |
|---|---|
| Additive | + - |
| Bitwise | & ^ | |
| Shift | << >> |
| Conditional | ?: |
(The conditional operator is only considered composite if either the 2nd or the 3rd operand is a composite expression.)
MISRA-C principles require that:
These restrictions are designed to force a sequence of arithmetic operations to be conducted in the same essential type.
The term composite expression supersedes the term complex expression which was defined in the MISRA-C:2004 document.