Subject: Re: gcc bug - temporary objects not destroyed properly
From: David Acton <[email-masked]>
To: Andrews Harold G Maj USAFA/DFCS <[email-masked]>
Cc: "[email-masked]'" <[email-masked]>
Date: Tue, 9 Oct 2001 20:34:45 +0000

Hi Andy,

> I've seen something similar with gcc 2.95 under Cygwin.  The main difference
> was that I had at least one virtual method in my class.  The compiler (using
> the -Wall option) mentioned that I should declare a *virtual* destructor.

Yes, I always compile with -Wall -pedantic and it complains vigorously if
you don't accompany virtual functions with a virtual destructor!

> The one I created was was essentially empty, and seemed to fix the problem
> (though I'm not completely certain why that was).  This might be something
> that could fix your problem if you want to continue using GCC 2.95.x

Yes, thanks - I'll give it a go. The actual class that caused the original
problem is one of the few in our application without any virtuality so that
might well be significant.

> BTW, I was not able to repeat the error using GCC 3.0.1 (though there were
> some simple-to-fix compiler errors).  You might want to consider upgrading.

I did install 3.0.1 and got my code to compile okay with it. But we went back
to 2.95 becaues 3.0.1 seems soooo slow at C++ (and 2.96 so dodgy! :-) It's
another good thing to try though.

Cheers

-- 
David Acton
Alphawave Ltd

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/