This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/35057] Integer variable value lost due to optimizations?



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]