This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Unnamed Struct / Union
- From: Marek Polacek <polacek at redhat dot com>
- To: Umesh Kalappa <umesh dot kalappa0 at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 23 Mar 2015 09:49:18 +0100
- Subject: Re: Unnamed Struct / Union
- Authentication-results: sourceware.org; auth=none
- References: <CAGfacvQMxPB2yEUtrh-SS-gcenSqQFMSrCwwO-hsxd=fSJEP2g at mail dot gmail dot com>
On Mon, Mar 23, 2015 at 02:07:28PM +0530, Umesh Kalappa wrote:
> Hi All ,
>
> GCC 4.8.3 ,pop up with below error
>
> /home/i16382/an.c:13:18: error: duplicate member 'bOriginator'
> unsigned bOriginator;
> ^
>
> for the case
>
> union
> {
> struct
> {
> unsigned bStatusType;
> unsigned bOriginator;
> };
> struct
> {
> unsigned originator;
> unsigned memoryContentsChanged;
> unsigned interruptPending;
> unsigned bOriginator;
> };
> } USB_WORD;
>
> is that expected behaviour ?
Yes.
Marek