[Bug c++/13005] Pointer wrongly adjusted for derived class containing virtual function

gdr at integrable-solutions dot net gcc-bugzilla@gcc.gnu.org
Fri Jan 9 04:24:00 GMT 2004


------- Additional Comments From gdr at integrable-solutions dot net  2004-01-09 04:24 -------
Subject: Re:  Pointer wrongly adjusted for derived class containing virtual function

"stephenma at telus dot net" <gcc-bugzilla@gcc.gnu.org> writes:

[...]

| > | The clear implication is that when there is only single
| > | inheritance, casting back and forth between base and derived
| > | pointers always yields valid pointers, even when the types are
| > | incomplete.
| > 
| > I disagree with  the assertion "clear implication".  I don't think it
| > was even an implication.  
| > 
| > The ARM specification did not impose any requirement on the object
| > layout.  Sorry.
| 
| If the ARM did not mean to imply what I said it implied, then why was it so
| consistent in apparently implying it -- at least twice?

Saying twice it implies, does not actually make it do so. 

| If the intention was to
| avoid expressing any preference on object layout, why did the authors even
| bother to make the quoted remarks?

You probably realized that the problem was more acute for multiple
inheritance -- and at the time, multiple inheritance was most  probably
one of the "feature" people happen to pick on.

| The only answer is that the authors were blessing the universal
| practice of the time, namely, that a base would always be at offset
| zero in a derived, when only single inheritance is involved.

I happen to work with one of the authors.  He never implies to impose
a Single True Object Model.

GCC changed object model it adopted the new ABI since GCC-3.0.
Any code hat relies on a particular preivous object model was broken
since then.

-- Gaby


-- 


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



More information about the Gcc-bugs mailing list