From owner-freebsd-hackers Sun Feb 21 20:44:29 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from rah.star-gate.com (rah.star-gate.com [209.249.129.138]) by hub.freebsd.org (Postfix) with ESMTP id 29EE111061 for ; Sun, 21 Feb 1999 20:44:28 -0800 (PST) (envelope-from hasty@rah.star-gate.com) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.9.1/8.8.8) with ESMTP id UAA88362 for ; Sun, 21 Feb 1999 20:43:25 -0800 (PST) (envelope-from hasty@rah.star-gate.com) Message-Id: <199902220443.UAA88362@rah.star-gate.com> X-Mailer: exmh version 2.0.2 2/24/98 To: hackers@FreeBSD.ORG Subject: gcc 2.8.1 Exceptions? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 21 Feb 1999 20:43:25 -0800 From: Amancio Hasty Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Does anyone know what is the magic incatation to make C++ exceptions work with gcc-2.8.1 from the ports distribution? . Exception handling appears to work with the stock gcc... /usr/local/bin/g++ -g -o foox foo.cpp foo.cpp: In function `void terminate()': foo.cpp:19: warning: `noreturn' function `terminate()' does return ./foox Abort (core dumped) /usr/bin/g++ -g -fhandle-exceptions -o foox foo.cpp {hasty} ./foox hello hello a Exception caught I shot the compiler! main() { int i = 0; try { i = i + 1; if (i > 0 ) throw "I shot the compiler!"; } catch ( char *p) { printf("hello \n"); printf("hello a \n"); printf("Exception caught %s\n", p); } } void terminate() { printf("hello terminate \n"); } Tnks, Amancio To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message