This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ and aliasing bools
- From: Daniel Berlin <dan at dberlin dot org>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org, <kenner at vlsi1 dot ultra dot nyu dot edu>
- Date: Fri, 25 Jan 2002 11:53:09 -0500 (EST)
- Subject: Re: g++ and aliasing bools
On Fri, 25 Jan 2002, Robert Dewar wrote:
> <<However, the important point is that the language semantics don't allow
> us to get it *right*, not just deciding. We may get it *wrong*, and think
> we have it *right*.
> >>
>
> Then you have misread the language specs, or GCC is wrong, no other
> possibilities exist!
Incorrect on all three points.
First, The devil is in the implementation specific portions that are part
of the
C++ ABI spec, and tell you what the layout of vtables, etc, is. This is
what one needs, in addition to the language spec, to be able to tell
aliasing properly.
At least, this is what is thought, anyway, it still might not be enough.
The language spec by itself, however, is *not* enough, and just using the
rules in it will ignore the whole problem of shared vtables, and given you
wrong answers *because* implementations do share pieces of classes.
Second, GCC is right because it just says that in C++, all aggregate type
can alias anything, avoiding the probblem altogether
Third, the above is a third dpossibility, which not only exists, but is
the current situation.
>