[previous] 0723 [next] Initialize none, first only, or all entries in this enumerator list.
Enumerations REFERENCE - ISO:C90-6.5.2.2 Enumeration Specifiers - Semantics

If an enumeration constant is not explicitly initialized, its value is determined by adding 1 to the value of the previous constant. If the first enumeration constant is not explicitly initialized, its value is 0.

Message 0723 is generated when an enumeration does not conform to any of the following principles:

For example:


/*PRQA S 553,722,2017,2211,2213,3602 ++*/

enum A {A1 = 5, A2, A3, A4};

enum B {B1 = 3, B2 = 5, B3 = 7, B4 = 9};

enum C {C1, C2, C3, C4};

enum D {D1, D2 = 5, D3, D4};                    /* Message 0723 */

enum E {E1 = 5, E2 = 7, E3 = 9, E4};            /* Message 0723 */

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents