Lucky hour! Grab a free trial license — offer ends in 00:59:58. Claim now
This diagnostic rule is based on the software development guidelines developed by MISRA (Motor Industry Software Reliability Association).
This diagnostic rule is relevant only to C++ programs. The analyzer has detected an enumeration whose members are initialized in a mixed way (explicitly and implicitly). This may result in duplicating their values.
Here is an example of incorrect code:
enum Suits
{
SUITS_SPADES = 1,
SUITS_CLUBS,
SUITS_DIAMONDS,
SUITS_HEARTS,
SUITS_UNKNOWN = 4
};
The way the elements are initialized here results in assigning the same value to the members 'SUITS_HEARTS' and 'SUITS_UNKNOWN'. It is not clear if this was done on purpose or by mistake.
The warning is not issued in the following cases:
This diagnostic is classified as:
|
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: