MISRAC++2023-11.6.3
In this section:
Synopsis
(Required) Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique
Enabled by default
Yes
Severity/Certainty
Medium/Medium

Full description
A duplicated implicit enumeration constant was found. This check is identical to MISRAC2012-Rule-8.12.
Coding standards
- MISRA C:2012 Rule-8.12
(Required) Within an enumerator list, the value of an implicitly-specified enumeration constant shall be unique
Code examples
The following code example fails the check and will give a warning:
/* skink equals to geko */
enum lizards { goanna = 1, parentie = 2, skink, geko = 3 };
The following code example passes the check and will not give a warning about this issue:
enum lizards { goanna, parentie, skink = 3, geko = 3 };