This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45510] Bug with anonymous unions and bit-fields
- From: "runipg at broadcom dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Sep 2010 03:31:10 -0000
- Subject: [Bug c++/45510] Bug with anonymous unions and bit-fields
- References: <bug-45510-19650@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from runipg at broadcom dot com 2010-09-03 03:31 -------
Subject: Re: Bug with anonymous unions and bit-fields
Wow, So there is a diff inside and outside a struct?
This is very counter-intuitive but I am to accept your explanation if that's
what the language says.
Thanks so much for looking into it and responding. Sorry if it is not a bug, I
googled for anything similar before filing it.
-Runip
On 02-Sep-2010, at 6:11 PM, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #5 from pinskia at gcc dot gnu dot org 2010-09-03 01:10 -------
> union {
> unsigned int a : 1,
> b : 4;
> unsigned int data;
> };
>
>
> This is an union of three elements each over lapping, that is a:1 overlaps with
> b:4 and data. So this is expected behavior as far as I can tell.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45510
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45510