Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique
Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique.
An implicitly specified enumeration constant has a value one greater than its predecessor. If the first enumeration constant is implicitly specified, then its value is 0. An explicitly specified enumeration constant has the specified value.
If implicitly and explicitly specified constants are mixed within an enumeration list, it is possible for your program to replicate values. Such replications can be unintentional and can cause unexpected behavior.
The rule checker flags an enumeration if it has an implicitly specified enumeration constant with the same value as another enumeration constant.
The constant constant1 has same value
as the constant constant2.
If you expect a rule violation but do not see it, refer to the documentation of Polyspace® Code Prover™ or Polyspace Code Prover Server™.
| Group: Declarations and Definitions |
| Category: Required |
| AGC Category: Required |