![]() |
![]() |
0494 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C90-6.3.5 Multiplicative Operators - Constraints | ||||||
This is a constraint error The type of the right hand operand is not compatible with this operation. The types of operand that can be used with any particular operator are restricted, so for example:
| * / | Both operands must be of arithmetic type |
| + | Both operands must be of arithmetic type ... or, one operand must be a pointer to an object and the other must be of integral type |
| - | Both operands must be of arithmetic type ... or, both operands must be pointers to qualified or unqualified versions of compatible object types ... or, the left operand must be a pointer to an object type and the right operand must have integral type |
| < <= >= > | Both operands must be of arithmetic type ... or, both operands must be pointers to qualified or unqualified versions of compatible object types ... or, both operands must be pointers to qualified or unqualified versions of compatible incomplete types |
| == != | Both operands must be of arithmetic type ... or, both operands must be pointers to qualified or unqualified versions of compatible types ... or, one operand must be a pointer to an object or incomplete type and the other must be a pointer to a qualified or unqualified version of void ... or, one operand must be a pointer and the other must be a null pointer constant |
/*PRQA S 2213,2216,3120,3199,3203,3408,3447 ++*/
struct ST {int a; int b;};
extern struct ST sta;
extern struct ST stb;
extern int *pi;
void foo(void)
{
int r;
if (sta == stb) /* Message 0493 and also 0494 */
{
}
r = 2 * pi; /* Message 0494 */
}
MISRA C:2012 Rules applicable to message 0494:
| 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 |