Synopsis: | Only the first entry in an enumerator shall be explicitly defined using '='. |
Language: | C |
Severity Level: | 8 |
Category: | Lexical Elements |
Description: |
Justification This rule prevents gaps in the enumeration values, which make iterating over the enum impossible. Example enum days { MONDAY = 3, /* RIGHT: only first enum is defined */ TUESDAY, WEDNESDAY } day; |