![]() |
![]() |
0544 | ![]() |
||||
![]() | |||||||
| Explicitly undefined | REFERENCE - ISO:C90-6.2.2.1 lvalues | ||||||
An attempt has been made to use the value of a union of incomplete type. This is not allowed and the result will be undefined. It is sometimes useful to define a pointer to an incomplete union type. But any attempt to dereference such a pointer will generate message 0544. For example:
/*PRQA S 506,2017,3408,3447,3617 ++*/
extern union UN *pun1; /* Message 3313 */
extern union UN *pun2;
extern void foo(void)
{
*pun1 = *pun2; /* Message 0544 */
pun1 = pun2; /* OK */
}
MISRA-C:2004 Rules applicable to message 0544:
| 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 |