[previous] 1044 [next] [E] Defining an anonymous struct object. This is a language extension.
Language extensions

This is a declaration of an anonymous structure. This is a language extension.

An anonymous struct is an unnamed object of an unnamed struct type. The names of the members of an anonymous struct must be distinct from the names of any other ordinary identifiers in the scope in which the anonymous struct is declared. The members of an anonymous struct are treated as ordinary objects within the scope in which the anonymous struct is declared and can be addressed as ordinary objects.

For example:


/*PRQA S 750,2017,3132,3227,3408 ++*/

struct                                                       /* Message 1044 */
{
    unsigned short us;
    unsigned char  uc[2];
};

extern void foo(unsigned short usx)
{
    us = usx;
}

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents