This is the mail archive of the gcc@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]

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.


> 


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