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 libstdc++/8670] Alignment problem in std::basic_string


------- Additional Comments From ncm-nospam at cantrip dot org  2005-01-23 03:52 -------
Somebody mentioned that using unions for type punning was described
in the textbooks as extremely bad form.  That's how I always thought
of it, too, but it seems, at least in Gcc, unions are now the right 
way to do type punning, instead of casting. For reference, see the 
notes under "-fstrict-aliasing" (which is turned on by -O2) in

  http://gcc.gnu.org/onlinedocs/gcc-3.4.3/gcc/Optimize-Options.html

(Thanks to Robert Love for having pointed this out to me.)

-- 


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


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