![]() |
![]() |
0542 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C90-6.6.4.1 The if Statement - Constraints, ISO:C90-6.6.5 Iteration Statements - Constraints | ||||||
This is a constraint error The controlling expression of this if, while, do while or for statement is not of scalar type. An expression of void, struct, union or array type is not permitted. For example:
/*PRQA S 2213,2216,3408,3416,3447 ++*/
struct ST {int a; int b;};
extern struct ST stx;
void bar(void);
void foo(void)
{
if (stx) /* Message 0542 and also 3344 */
{
}
if (bar()) /* Message 0542 and also 0543 and 3344 */
{
}
}
MISRA C:2012 Rules applicable to message 0542:
| 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 |
See also:
![]() | ||
| 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 |