This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35057] Integer variable value lost due to optimizations?
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2008 16:37:54 -0000
- Subject: [Bug c++/35057] Integer variable value lost due to optimizations?
- References: <bug-35057-15492@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-03-03 16:37 -------
basic_endpoint()
: data_()
{
asio::detail::sockaddr_in4_type& data
= reinterpret_cast<asio::detail::sockaddr_in4_type&>(data_);
data.sin_family = 2;
data.sin_port = 0;
data.sin_addr.s_addr = ((in_addr_t) 0x00000000);
}
you are violating C/C++ type-based aliasing rules here (and in other places).
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35057