![]() |
![]() |
0557 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C90-6.3.16 Assignment Operators - Constraints | ||||||
This is a constraint error An object of arithmetic type has been assigned the value of an expression which isn't of arithmetic type - maybe it's a pointer or a 'struct' or a 'union'. For example:
/*PRQA S 750,759,2213,2216,3132,3198,3199,3203,3210,3205,3408,3447,3623,3625 ++ */
struct ST1 { int si; char sbuf[10];};
union UN1 { int ui; int uj;};
extern struct ST1 st1a;
extern union UN1 un1a;
extern int *pi;
extern int gi;
extern char cbuf[10];
extern void test(void)
{
int x;
x = gi; /* */
x = st1a; /* Message 0557 */
x = un1a; /* Message 0557 */
x = cbuf; /* Message 0557 */
x = pi; /* Message 0557 */
}
MISRA C:2012 Rules applicable to message 0557:
| 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 |