[previous] 0545 [next] [U] The value of an incomplete 'struct' may not be used.
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:2012 Rules applicable to message 0545:

Rule-1.3  (Required) There shall be no occurrence of undefined or critical unspecified behaviour


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