home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!ukma!gatech!news.byu.edu!ux1!fcom.cc.utah.edu!dave
- From: dave@news.ccutah.edu (Dave Martin)
- Subject: BC++ 3.0 vs 3.1 bug fixed?
- Message-ID: <1993Jan28.151015.11739@fcom.cc.utah.edu>
- Sender: news@fcom.cc.utah.edu
- Reply-To: dave@csulx.weber.edu
- Organization: University of Utah Computer Center
- X-Newsreader: Tin 1.1 PL3
- Date: Thu, 28 Jan 93 15:10:15 GMT
- Lines: 37
-
- I am having a problem in BC++3.0 with virtual functions.
- It was compiled huge model with and without optimization, and various
- other flags is dos mode.
-
- Basically, the wrong function is being invoked.
- my program is structured like this:
-
- class base
- {
- ..
- virtual somefunc()
- };
-
- class a : public class base
- {
- ..
- virtual unrelatedfunc()
- };
-
- class b: public class base,public class someotherbase
- {
- ..
- virtual somefunc()
- };
-
- b someb;
- someb->somefunc() actually calls unrelatedfunc in class a.
-
- I verified this with the debugger, and by putting output statements
- just before the call to someb->somefunc(), and in unrelatedfunc().
- needless to say, the program goes nuts because the context is totally
- wrong for unrelatedfunc().
-
- Is this a known problem? is it fixed in 3.1?
-
- dave@csulx.weber.edu
-
-