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++/15837] Optimization (of templatized functions?)


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-06 04:49 -------
No what I am saying is that your code does things which are "undefined" by the C++ standard so the 
compiler is able to do anything (including erasing your hard drive, no gcc will not produce code to do 
that though).  Casting to a different type and then accessing the data inside is declared as undefined 
(there are a few exceptions to that rule, like you access the data via a char pointer and there is no 
aliasing problems, you can cast to a type which adds const or violate and there is no aliasing problems 
but casting between different pointer types and then accessing the data for both of the type is 
undefined).

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15837


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