🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

g++ bug or feature?!

#1028
From: Saumen Dutta
Date: Mon, 05 Oct 1992 23:36
66 lines
1780 bytes
I have following problems with gcc.

While compiling the following program ( actually part of a big program
but shortened for convinience) it does'nt complain anything but while executing
it gives a BUS error. However if I interchange the position of xdisp and coord
in the definition of xwin, (i.e. class xwin: virtual public coord, virtual
public xdisp{.... ) it works fine!. Can somebody tell me what is going on.
I could not find anything from the gdb. I am using gcc2.2.2. I understand
that I didn't have to use virtual classes, but I guess it is syntactically okay!
Any feedback will be appreciated!!

 
class coord{
 public:
    double ctm[6]; 
    coord();
};

//--------------------------------------------------------

class xdisp{
  
public:
  xdisp();
};

//------------------------------------------------------------

class xwin: virtual public xdisp, virtual public coord{

public:
  xwin();

};

//----------------------------------------------------------



main()
{
        xwin tryme;
}


xwin::xwin():xdisp(), coord()
{

}


xdisp::xdisp()
{
}


coord::coord(){
        ctm[0] = (double)1.0;
        ctm[1] = ctm[2] = (double)0.0;
        ctm[4] = (double)1.0;
        ctm[5] = (double)0.0;
} 



If you decide to post the reply please send a e-mail too.
Technical Details
Message-ID: <1992Oct5.233614.4753@ucs.att.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucs.ATt.COM!skdutta

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucs.ATt.COM!skdutta
From: skdutta@ucs.ATt.COM (Saumen Dutta)
Subject: g++ bug or feature?!
Message-ID: <1992Oct5.233614.4753@ucs.att.com>
Sender: gnulists@ai.mit.edu
Organization: AT&T Universal Card Services, Jacksonville FL
Distribution: gnu
Date: Mon, 5 Oct 1992 23:36:14 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 67