--- Additional Comments From dirk at cle-mens dot de 2005-02-26 10:35
---
(In reply to comment #1)
> Invalid you are violating C90/C99 aliasing rules.
Ok. But where is the compiler warning?
The dokumentation of gcc says: (man gcc)
-Wstrict-aliasing
This option is only active w
--- Additional Comments From dirk at cle-mens dot de 2005-02-24 13:56
---
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
>
> You are accessing an object of type "class data" through an lvalue of type
> "uint64".
on
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dirk at cle-mens dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20189
--- Additional Comments From dirk at cle-mens dot de 2005-02-24 12:21
---
(In reply to comment #1)
> Invalid for the same reason as PR 20184...
>
I get the same failure if I use (little endian system)
inline data::operator uint64 () const
{ return *reinterpret_cas
--- Additional Comments From dirk at cle-mens dot de 2005-02-24 10:38
---
The reinterpret_cast solves the problem with this old code.
inline data::data ( uint32 num ) { *reinterpret_cast(this) = num; }
--
What|Removed |Added
--- Additional Comments From dirk at cle-mens dot de 2005-02-24 10:35
---
The cast is, perhaps, illegal. But after the cast there is an assignment from
uint32 to uin64. And that assignment does not work.
--
What|Removed |Added
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dirk at cle-mens dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20185
printf("%08x:%08x\n",D.hi,D.lo);
}
--
Summary: assignment error in inline function
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassign