3.7.14. Unnamed fields

When embedding a structure or union within another structure or union, you do not have to name the internal structure. You can access the contents of the unnamed structure without using .name to reference it.

Unnamed fields are the same as anonymous unions and structures.

Mode

Supported in GNU mode for C90 and C99 only.

Example

struct
{
    int a;
    union
    {
        int b;
        float c;
    };
    int d;
} Unnamed_Fields_0;

int Unnamed_Fields_1()
{
    return Unnamed_Fields_0.b;   
}

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential