![]() |
![]() |
0545 | ![]() |
||||
![]() | |||||||
| Explicitly undefined | REFERENCE - ISO:C90-6.2.2.1 lvalues | ||||||
An attempt has been made to use the value of a struct of incomplete type. This is not allowed and the result will be undefined. It is sometimes useful to define a pointer to an incomplete struct type. But any attempt to dereference such a pointer will generate message 0545. For example:
/*PRQA S 506,2017,3408,3447,3617 ++*/
extern struct ST *pst1; /* Message 3313 */
extern struct ST *pst2;
extern void foo(void)
{
*pst1 = *pst2; /* Message 0545 */
pst1 = pst2; /* OK */
}
MISRA-C:2004 Rules applicable to message 0545:
| Rule 1.2 (Required) | No reliance shall be placed on undefined or unspecified behaviour. |
| Rule 18.1 (Required) | All structure and union types shall be complete at the end of a translation unit. |
See also:
![]() | ||
| 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 |