![]() |
![]() |
3342 | ![]() |
||||
![]() | |||||||
| Control flow | |||||||
The controlling expression of a for loop (the second expression) is usually a relational or equality operation - for example, testing the value of a loop control variable. Message 3342 is generated when this expression contains any operations involving floating point operands. For example:
/*PRQA S 2017,3121,3132,3227,3408,3447 ++*/
extern float ftbuf[100];
extern void foo(float ftx, float fty)
{
float ft;
int i;
for (i = 0; ftbuf[i] > 0.0F; ++i) /* Message 3342 */
{
/* ... */
}
for (ft = 0.0F; ft < ftx; ft = ft + fty) /* Message 3342 and 3340 */
{
/* ... */
}
}
MISRA-C:2004 Rules applicable to message 3342:
| Rule 13.4 (Required) | The controlling expression of a for statement shall not contain any objects of floating type. |
![]() | ||
| 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 |