TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
ASML C Coding Standard
Search

Rule:  6.4.4.3.aChecked automatically with code checker

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;