GCC Issue with unnammed nested struct in c

Jonathan Wakely jwakely.gcc@gmail.com
Wed Jun 26 14:58:00 GMT 2013


On 26 June 2013 13:57, naveen yadav wrote:
> Dear All,
>
> struct xx
> {
>         int x;
>         struct yy *p;
>         struct
>         {
>                 int  s;
>         };
>         struct
>         {
>                 int  s;
>         };
>
> };
>
> int main()
> {
>
>         struct xx xyz;
>         printf("%d",sizeof(xyz));
>         return 0;
> }
>
> the above code compile well without any warning.

You must be using an old version of GCC, it is an error with GCC 4.6 and later.

> Here my question is
> 1. How can I distinguish  two 's' variable.

You can't.

> 2. What is use case.

There isn't one.



More information about the Gcc-help mailing list