/* >>>------------------------------------------------------------ * * File: rule_9.3.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 9.3 (Required): * In an enumerator list, the '=' construct shall not be used to * explicitly initialise members other than the first, unless all * items are explicitly initialised. * * Implemented by message: * 723 Initialize none, first only, or all entries in this * enumerator list. * * <<<------------------------------------------------------------ */ /* PRQA S 3205 ++ */ #include "misra.h" #include "m2cmex.h" #define VAL 4294 extern S16 test_0903( void ) { enum game { tennis = 2, cricket, golf, hurling }; /* OK */ enum town { London, Paris, New_York }; /* OK */ enum country {Germany = 1, Italy = 2, Australia = 3}; /* OK */ enum color { red, blue = VAL, green }; /* MISRA Violation */ enum cars { BMW, Mercedes, Ford = VAL }; /* MISRA Violation */ return 0; }