Boost logo

Boost Users :

Subject: Re: [Boost-users] [Off topic] Strict Aliasing white paper redux
From: Václav Haisman (v.haisman_at_[hidden])
Date: 2011-01-03 01:53:05


Patrick Horgan wrote, On 3.1.2011 7:11:
> Some time ago, I posted a link here to my (then new) white paper on
> strict-aliasing. I wrote it because people keep posting, on this and on
> other lists, questions that show a basic misunderstanding of aliasing and
> what the rules in C and C++ standards on aliasing are intended to
> communicate. I got some great feedback and have posted a new revision,
> http://dbp-consulting.com/StrictAliasing.pdf. I'm hoping that people on this
> list will review the paper and tell me some more ways of improving it. My
> intention is to write a paper that will make it so that I won't have to keep
> answering the same questions over and over again;) I'll just point people at
> the paper.
Nice paper. But I believe parts are wrong or misleading. Misleading is the
part about -fno-strict-aliasing. It is GCC specific. The wrong part, I think,
is the part suggesting union as a solution. As far as I know you can only
read from union through a member that you have put into it. The fact that you
can access different union member is also an extension, though one more
common than just GCC specific.

-- 
VH

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net