Main Content

Always generate a default case for switch

Default case for all switch statements

Description

App Configuration Pane: Advanced

Configuration Objects: coder.EmbeddedCodeConfig

Default case for all switch statements.

Some coding standards, such as MISRA™, require the default case for switch statements.

Settings

Off

This value is the default value.

The code generator might not generate a default case for some switch statements.

On

The code generator produces a default case for all switch statements in the generated code.

Programmatic Use

Property: GenerateDefaultInSwitch
Values: false | true
Default: false

Version History

Introduced in R2017b