This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38818] C++ bitfield static initialisation problem
- From: "john dot spelis at 3dlabs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jan 2009 22:16:05 -0000
- Subject: [Bug c++/38818] C++ bitfield static initialisation problem
- References: <bug-38818-8983@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from john dot spelis at 3dlabs dot com 2009-01-12 22:16 -------
Subject: Re: C++ bitfield static initialisation problem
Thank you.
(I'm suitably humbled).
Cheers
On 12 Jan 2009, pinskia at gcc dot gnu dot org wrote:
>
>
> ------- Comment #1 from pinskia at gcc dot gnu dot org 2009-01-12 21:37 -------
> *(unsigned long *)this=l;
>
> You are violating C/C++ aliasing rules which invokes undefined behavior as you
> are accessing a giChannelTiming as a unsigned long.
>
> Either use -fno-strict-aliasing or memcpy or unions or the attribute may_alias
> to fix your code
>
>
> --
>
> pinskia at gcc dot gnu dot org changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED |RESOLVED
> Resolution| |INVALID
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38818
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38818