Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 12868 invoked from network); 21 Aug 2007 16:37:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2007 16:37:52 -0000 Received: (qmail 47678 invoked by uid 500); 21 Aug 2007 16:37:49 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 47668 invoked by uid 500); 21 Aug 2007 16:37:49 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 47657 invoked by uid 99); 21 Aug 2007 16:37:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 09:37:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 16:38:17 +0000 Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.6) with ESMTP id l7LGbJPH017397 for ; Tue, 21 Aug 2007 16:37:19 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 21 Aug 2007 10:36:30 -0600 Message-ID: <46CB14BF.6040400@roguewave.com> Date: Tue, 21 Aug 2007 10:37:19 -0600 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: svn commit: r563682 - in /incubator/stdcxx/trunk/src: once.cpp once.h References: <20070807222411.3E1C81A981A@eris.apache.org> <7BDB2168BEAEF14C98F1901FD2DE6438C9158B@epmsa009.minsk.epam.com> <46C1DAB6.2000908@roguewave.com> <7BDB2168BEAEF14C98F1901FD2DE6438D3EA55@epmsa009.minsk.epam.com> In-Reply-To: <7BDB2168BEAEF14C98F1901FD2DE6438D3EA55@epmsa009.minsk.epam.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Aug 2007 16:36:30.0710 (UTC) FILETIME=[6D905160:01C7E411] X-Virus-Checked: Checked by ClamAV on apache.org Farid Zaripov wrote: >> -----Original Message----- >> From: Martin Sebor [mailto:sebor@roguewave.com] >> Sent: Tuesday, August 14, 2007 7:39 PM >> To: stdcxx-dev@incubator.apache.org >> Subject: Re: svn commit: r563682 - in >> /incubator/stdcxx/trunk/src: once.cpp once.h >> >> Thanks for pointing it out! I noticed it too when I tested >> the change on Windows but I haven't decided how to deal with >> it yet. Compilers often assume that functions with C linkage >> don't throw exceptions and generate code that breaks when an >> exception does end up being thrown. >> I think MSVC is one of them, and gcc another. We should >> probably add a config test to determine whether a compiler >> allows exceptions to pass through C code and only rethrow the >> exception only when it does. >> In the opposite case we'll need to decide how to handle the exception. >> Any suggestions? > > Why the internal function should be extern "C"? So they can be passed to pthread_create() which is in all cases I know of a C interface (i.e., it expects a pointer to a function with a C language linkage as an argument). Functions with different language linkage have distinct types and are incompatible with one another. Most compilers including MSVC and gcc) don't implement this rule and as a result present a serious portability problem. See the following gcc bug report for an example of such a problem: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=2316 Martin