On 11/10/2010 01:16 AM, Andrew Haley wrote:
...elision by patrick...
The aliasing rules are nothing to do with C99: they have always
been in Standard C.
Thanks. I didn't know that (or if I did I forgot
somewhere). I just really noticed people talking about
strict aliasing lately (the last 3 or 4 years I've seen
it a lot). Do you think it's because the compilers are
getting better at complaining about type-punning that's
outside of the aliasing rules?
You really ought to refer to the standard, so people can see the
official rules for themselves.
That's a good point. I suppose I could put a link to a
publicly available draft version of the C and the C++
standards. Is there anyplace now where a final
(non-draft) version of some version of the C and the
C++ standards if freely available to the public?
I've seen though that often people go to the standards
and look at the aliasing rules with a strange world
view and get more confused about aliasing and not
less. That's really the point of my document, to get
regular developers to understand what aliasing is
before they go and look at the rules so they understand
what they're reading. Do you suppose it would be
appropriate to refer them to the standards at the end
of the top section, before I start the type-punning
section?
Patrick
Andrew.