Main Content

Duplicate enumeration member names

Specify the action to take if the code generator detects two enumeration types with same member names

Model Configuration Pane: Code Generation / Identifiers

Description

Select the diagnostic action to take if the code generator detects two enumeration types with same member names. This parameter applies to only enumeration with imported data scope and the same storage type and value.

Settings

error (default) | none | warning
none

When the code generator detects two enumeration types with the same member names, the code generation proceeds.

warning

When the code generator detects two enumeration types with the same member names, the software issues a warning message and the code generation proceeds.

error

When the code generator detects two enumeration types with the same member names, the software issues an error message and terminates the code generation.

Examples

expand all

Consider these enumerations:

typedef int32_T enumA;
#define a       (0)
#define p       (1)
typedef int32_T enumB;
#define b       (0)
#define p       (1)
The enumerations have the same int32 storage type. The enumeration member p with value 1 is the same for enumA and enumB.

Generate an error or warning message or allow code generation for duplicate enumeration member names by using the Duplicate enumeration member names configuration parameter.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: EnumMemberNameClash
Type: character vector
Value: 'none' | 'warning' | 'error'
Default: 'error'

Version History

Introduced in R2019b