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++/36971] Portability issue from gcc 2.96 to gcc 4.1.1 for c++ casting



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-08-10 23:28 -------
>d *ptr = reinterpret_cast<d*> (c1);

You are violating C/C++ aliasing rules as *c1 here is a c and not a d.  Even
though d inherits from c, this is undefined behavior still as it is not the
opposite way around.


-- 

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


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