![]() |
![]() |
0321 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C99-6.8.5 Iteration statements - Constraints | ||||||
This is a constraint error In the ISO:C99 language, a declaration is permitted in the first clause of a 'for-loop', but this declaration may only define an object; it is not permitted to declare any other identifiers, e.g. tags, typedefs or enumerator constants. For example:
/*PRQA S 320,1319,1481,2213,3205,3220,3408,3602 ++*/
void foo(void)
{
for ( enum et {RED, GREEN, ORANGE} ex = RED; ex < ORANGE; ++ex) /* Message 0321 + 0321 */
{
}
}
MISRA-C:2004 Rules applicable to message 0321:
| Rule 1.1 (Required) | All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192 |
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |