X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
Message-ID: <4F2835F0.5050704@t-online.de>
Date: Tue, 31 Jan 2012 19:41:52 +0100
From: Christian Franke <Christian.Franke@t-online.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110928 Firefox/7.0.1 SeaMonkey/2.4.1
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: llvm/clang 3.0-1 silently ignores C++ exception handling
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Clang++ 3.0-1 does not produce any exception handling code. Unwind 
tables and code within catch(.) {...} blocks are not generated. Throw 
always abort()s program.

$ cat trycatch.cc
void do_work();
void handle_error();

void func()
{
   try { do_work();  }
   catch (...) { handle_error(); }
}

$ clang++ -fexceptions -S trycatch.cc

$ grep handle_error trycatch.s

$ cat trycatch.s
...
__Z4funcv:
         pushl   %ebp
         movl    %esp, %ebp
         subl    $8, %esp
         calll   __Z7do_workv
         addl    $8, %esp
         popl    %ebp
         ret


$ g++ -S trycatch.cc

$ grep handle_error trycatch.s
         call    __Z12handle_errorv


Is this as excepted?

Christian


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

