🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1396

Section 10.10C of the ARM & GNU G++ 2.3.3

#1396
From: David Binderman 3841
Date: Thu, 21 Jan 1993 23:24
46 lines
1669 bytes
Hello there,

I have GNU G++ 2.2.2 and GNU G++ 2.3.3 on a Sun 4 SPARC. I have tried out
both compilers with the code from Section 10.10C of the ARM page 233

2.2.2 produced the following

BW:f()
MW:g()
BMW::h()
BW:f()

2.3.3 produced the following 

W::f()
W::g()
BMW::h()
BW:f()

It seems that 2.2.2 is correct, but 2.3.3 is not.

The following memory layout seems to be used by both 2.3.3 and 2.2.2

BMW::BMW()
sizeof 28
0xf7fff858 0xf7fff86c
0xf7fff85c 0x3
0xf7fff860 0xf7fff86c
0xf7fff864 0x2
0xf7fff868 0x4
0xf7fff86c 0x1
0xf7fff870 0x40b0

I note with interest only one vtbl pointer. The ARM suggests, but does
not require, that there are three vtbl pointers in a BMW class. I
checked with cfront 3.0 and another C++ compiler, and they both agreed
that there can be three vtbl pointers in a BMW.

While I accept and recognise that different implementation strategies
of language features are permitted, it is not clear to me that two missing
vtbl pointers is a feature or a bug. I would appreciate your opinion.

Regards

David C Binderman     Dept US/ESI, Bau 60, SEL-Alcatel AG, Lorenz Strasse 10,
D-7000 Stuttgart 40, Germany      dcb@us-es.sel.de   Tel: +49 711 821 3841
Technical Details
Message-ID: <9301211718.AA06537@slsvitt>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!us-es.SEl.DE!dcb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!us-es.SEl.DE!dcb
From: dcb@us-es.SEl.DE (David Binderman 3841)
Newsgroups: gnu.g++.bug
Subject: Section 10.10C of the ARM & GNU G++ 2.3.3
Date: 21 Jan 1993 18:24:45 -0500
Organization: GNUs Not Usenet
Lines: 47
Sender: daemon@cis.ohio-state.edu
Approved: bug-g++@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9301211718.AA06537@slsvitt>