Switch Statements

The compiler can encode switch statements using one of several strategies. By default, the compiler chooses a strategy based on the case values that are used inside the switch statement. Each switch statement is assigned its strategy independently.

The type of strategy can be indicated by using the #pragma switch directive (see The #pragma Switch Directive), which also lists the available strategy types. There can be more than one strategy associated with each type.

There is information printed in the assembly list file for each switch statement detailing the value being switched and the case values listed (see Switch Statement Information).

The compiler does not support case ranges when building for the C99 language standard.