purify 4.1 and egcs still appear to be incompatible.
Martin von Loewis
martin@mira.isdn.cs.tu-berlin.de
Tue Feb 17 23:44:00 GMT 1998
> If I take all my classes that use this default copy constructor to copy
> a single bogus byte, and specifically give them a copy constructor (one
> which does nothing), I should stop getting these purify errors?
It may be your classes, but I think it's rather the classes in STL.
STL uses dummy classes, which only serve to select the right template
implementation. As it still seems to make instances of these dummy
classes (at least for parameter passing), it does those unnecessary copies.
If you give a copy constructor of
X::X(const X&){}
you explicitely tell the compiler that copying this object does not
do anything.
> And furthermore, when I compile with optimization, the resulting code
> should be _no_ different either way?
Yes, that's the plan. If you have inline constructors for empty classes,
egcs should know that instances of these classes really do *nothing*
interesting.
Regards,
Martin
More information about the Gcc-bugs
mailing list