Mail Archives: djgpp/1996/10/15/09:17:02
Hi all,
I think I encountered a bug in gcc (I'm using DJGPP v2), which drove me
crazy quite a long time. I've defined a class hierarchie, which is
similiar to the following (of course it's bigger and more complex, but
this should be enough to illustrate the problem):
class A {
protected:
unsigned *Ptr;
...
};
class B : public A {
...
};
Now I made a mistake in the constructor of class B: I referred to Ptr with
B :: Ptr. But gcc didn't reported the bug and compiled everything. The
Consequence of this was, that Ptr was internally misaddressed by the
compiler and every data-write to Ptr went somewhere else overwriting other
local data of the classes or even the virtual function call mechanisms
which resulted in calls to nirvana and so on (wasn't that nice ;)). Maybe
this bug is only due to some wired structures within my program and
doesn't occure in general (didn't tested that yet), but I just wanted to
warn you all ....
c-ya,
Piotr
--
Piotr DOT Kasprzak AT xyz DOT prima DOT ruhr DOT de http://www.prima.ruhr.de
- Raw text -