Re: GCC Issue with unnammed nested struct in c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux