From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 9 17:40:02 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C91411065674 for ; Wed, 9 Apr 2008 17:40:02 +0000 (UTC) (envelope-from faber@ISI.EDU) Received: from boreas.isi.edu (boreas.isi.edu [128.9.160.161]) by mx1.freebsd.org (Postfix) with ESMTP id AAA638FC2C for ; Wed, 9 Apr 2008 17:40:02 +0000 (UTC) (envelope-from faber@ISI.EDU) Received: from zod.isi.edu (zod.isi.edu [128.9.168.221]) by boreas.isi.edu (8.13.8/8.13.8) with ESMTP id m39HT5dp026744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 9 Apr 2008 10:29:06 -0700 (PDT) Received: (from faber@localhost) by zod.isi.edu (8.14.2/8.14.2/Submit) id m39HT52o079741; Wed, 9 Apr 2008 10:29:05 -0700 (PDT) (envelope-from faber) Date: Wed, 9 Apr 2008 10:29:05 -0700 From: Ted Faber To: Yuri Message-ID: <20080409172905.GA33086@zod.isi.edu> References: <47FCF12D.3070902@rawbw.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <47FCF12D.3070902@rawbw.com> User-Agent: Mutt/1.4.2.3i X-url: http://www.isi.edu/~faber X-ISI-4-43-8-MailScanner: Found to be clean X-MailScanner-From: faber@zod.isi.edu Cc: freebsd-hackers@freebsd.org Subject: Re: C++ exceptions are broken in FreeBSD with gcc-compiled code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2008 17:40:02 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 09, 2008 at 09:39:09AM -0700, Yuri wrote: > I am unable to make a C++ program to catch an exception using the the=20 > system g++ compiler. >=20 > > cat exc.C > #include > #include > using namespace std; >=20 > int main() { > try { > throw string("String"); > } catch (string s) { > cout << "Caught an exception \"" << s << "\"\n"; > } > } >=20 >=20 > * Failed attempts with system compiler (using /lib/libgcc_s.so.1 and=20 FYI it works here: zod:~$ cat > test.cc #include #include using namespace std; int main() { try { throw string("String"); } catch (string s) { cout << "Caught an exception \"" << s << "\"\n"; } } zod:~$ g++ test.cc=20 zod:~$ ./a.out Caught an exception "String" zod:~$ g++ -v=20 Using built-in specs. Target: i386-undermydesk-freebsd Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 4.2.1 20070719 [FreeBSD] zod:~$ uname -a FreeBSD zod.isi.edu 8.0-CURRENT FreeBSD 8.0-CURRENT #5: Tue Apr 1 13:00:38 PDT 2008 root@zod.isi.edu:/usr/obj/usr/src/sys/ZOD i386 --=20 Ted Faber http://www.isi.edu/~faber PGP: http://www.isi.edu/~faber/pubkeys.= asc Unexpected attachment on this mail? See http://www.isi.edu/~faber/FAQ.html#= SIG --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkf8/OEACgkQaUz3f+Zf+XsPIQCg/FvDoXieoFihPmnb5JaO/VWp EZUAoPP+LInURskze68jdW0bKTaWlc7G =Hilr -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--