🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bugs
Article #1

gcc2.2.2 problem / bug ?

#1
From: Saumen Dutta
Date: Mon, 05 Oct 1992 03:48
67 lines
1732 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.034847.26571@ucs.att.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!ucs!skdutta

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bugs,gnu.g++.help
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!ucs!skdutta
From: skdutta@ucs.att.com (Saumen Dutta)
Subject: gcc2.2.2 problem / bug ?
Message-ID: <1992Oct5.034847.26571@ucs.att.com>
Organization: AT&T Universal Card Services, Jacksonville FL
Date: Mon, 5 Oct 1992 03:48:47 GMT
Lines: 67