From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19221 invoked by alias); 25 Feb 2002 11:14:15 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 19053 invoked from network); 25 Feb 2002 11:14:10 -0000 Received: from unknown (HELO d12lmsgate-3.de.ibm.com) (195.212.91.201) by sources.redhat.com with SMTP; 25 Feb 2002 11:14:10 -0000 Received: from d12relay02.de.ibm.com (d12relay02.de.ibm.com [9.165.215.23]) by d12lmsgate-3.de.ibm.com (1.0.0) with ESMTP id MAA66472 for ; Mon, 25 Feb 2002 12:14:08 +0100 Received: from d12ml007.de.ibm.com (d12ml007_cs0 [9.165.223.36]) by d12relay02.de.ibm.com (8.11.1m3/NCO v5.01) with ESMTP id g1PBFwJ100614 for ; Mon, 25 Feb 2002 12:15:59 +0100 Importance: Normal Subject: Re: About exit4.c To: Pthreads Developers List X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 Message-ID: From: "Alexander Terekhov" Date: Mon, 25 Feb 2002 03:14:00 -0000 X-MIMETrack: Serialize by Router on D12ML007/12/M/IBM(Release 5.0.8 |June 18, 2001) at 25/02/2002 12:15:42 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-SW-Source: 2002/txt/msg00027.txt.bz2 [...uncaught exceptions...] > This violates the Ansi C++ specification... Nope. FYI: http://groups.google.com/groups?as_umsgid=3C75280D.571C0C0A%40web.de http://groups.google.com/groups?as_umsgid=3C7633AF.4A08EFBF%40web.de http://groups.google.com/groups?as_umsgid=3C741E98.BFA02412%40web.de http://groups.google.com/groups?as_umsgid=3C77AFCB.481D2587%40web.de regards, alexander. Pietrobon Marcello @sources.redhat.com on 02/24/2002 07:38:55 AM Sent by: pthreads-win32-owner@sources.redhat.com To: Pthreads Developers List cc: Subject: Re: About exit4.c Even if it is not important It might be good to know about an other bug (probably) of the Microsoft compiler (which I discovered trying to fix the problem with exit4.c): The following code: ---------------------------------- #include class CheckDestructor { public: CheckDestructor() { printf("CheckDestructor"); }; ~CheckDestructor() { printf("~CheckDestructor"); }; }; void f() { CheckDestructor check; throw 1; } int main(int argc, char* argv[]) { //try //{ f(); //} //catch (...) { // printf("inside catch(...)\n"); //} return 0; } ---------------------------------- doens't call the destructor ~CheckDestructor(). But it does that if we put f() inside the try... catch block The reason is that main() is called from crt0.c inside a __try ... __except block, which does not call the destructor. This violates the Ansi C++ specification dec96: see http://www.codeproject.com/cpp/ANSI-cpp-dec96/except.asp where 15.2 Constructors and destructors [except.ctor]. Best Regards, Marcello