Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Jun 1997 21:06:13 -0400
From:      "Kevin P. Neal" <kpneal@pobox.com>
To:        Brian Somers <brian@awfulhak.org>
Cc:        Steve Howe <un_x@anchorage.net>, freebsd-hackers <hackers@FreeBSD.ORG>
Subject:   Re: Borland 16bit bcc vs cc/gcc (float) 
Message-ID:  <1.5.4.32.19970602010613.00856120@mindspring.com>

next in thread | raw e-mail | index | archive | help
At 01:15 AM 6/1/97 +0100, Brian Somers wrote:
>> At 12:03 PM 5/31/97 -0800, Steve Howe wrote:
>[.....]
>> Who says you always have to use exit()?
>> 
>> In fact, I've observed C++ code that never calls the destructors if you
>> exit() of out a program.
>[.....]
>
>Yep, it at least won't call the destructors for the main() stack
>vars, no matter how smart the compiler is.

What I saw was my C++ program crashing when calling the final return(),
but not crashing when I called exit(). 

I ended up fixing the destructor for one of my classes, so it didn't core
dump when the object was destroyed. I never investigated the exact behavior
beyond that, if figured "hey, don't use exit() in C++" and let it rest at that.
--
XCOMM Kevin P. Neal, Junior, Comp. Sci.     -   House of Retrocomputing
XCOMM  mailto:kpneal@pobox.com              -   http://www.pobox.com/~kpn/
XCOMM  kpneal@eos.ncsu.edu              Spoken by Keir Finlow-Bates:
XCOMM "Good grief, I've just noticed I've typed in a rant. Sorry chaps!"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1.5.4.32.19970602010613.00856120>