Duplicate enumeration member names

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.

Category: Code Generation > Identifiers

Settings

Default: error

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.

Command-Line Information

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

Example

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

Related Topics