![]() |
![]() |
0322 | ![]() |
||||
![]() | |||||||
| 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 the only storage-class specifiers which may be used are 'auto' and 'register'. In other words it is not permitted to use 'static', 'extern' or 'typedef'. For example:
/*PRQA S 320,3120,3220,3223,3408 ++*/
void foo(void)
{
for (static int i = 0; i < 10; ++i) /* Message 0322 */
{
}
}
MISRA C:2012 Rules applicable to message 0322:
| Rule-1.1 (Required) | The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits |
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |