[previous] 0636 [next] [U] There are no named members in this 'struct' or 'union'.
Explicitly undefined REFERENCE - ISO:C90-6.5.2.1 Structure and Union Specifiers - Semantics

This struct or union has no named members.

Unnamed members are permitted in structs and unions; in fact, unnamed bit-fields are often used for padding purposes. However defining a struct/union with no named members at all is not useful and results in undefined behaviour.

For example:


/*PRQA S 553,2017,3131,3621 ++*/

struct STX
{
    unsigned int x1;
    unsigned int xba:3;
    unsigned int :0;
    unsigned int xbb:5;
    unsigned int x2;
};

struct STY
{
    unsigned int;               /* Message 0660 */
    unsigned int;               /* Message 0660 */
    unsigned int :0;
    unsigned int;               /* Message 0660 */
    unsigned int;               /* Message 0660 */
};                              /* Message 0636 */


MISRA-C:2004 Rules applicable to message 0636:

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