purify 4.1 and egcs still appear to be incompatible.
Jason Merrill
jason@cygnus.com
Wed Feb 18 00:50:00 GMT 1998
>>>>> Brad M Garcia <bgarcia@fore.com> writes:
> 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?
> And furthermore, when I compile with optimization, the resulting code
> should be _no_ different either way?
Not necessarily. A class with a user-defined copy constructor, even one
that does nothing, has different semantics from one with a trivial,
implicitly generated copy constructor. For one thing, gcc passes such
classes by invisible reference instead of in registers.
A better solution is to make g++ handle empty classes better.
Jason
More information about the Gcc-bugs
mailing list