Article View: gnu.gcc.help
Article #50426(none)
From: reinier
Date: Wed, 29 Sep 1993 07:18
Date: Wed, 29 Sep 1993 07:18
53 lines
2323 bytes
2323 bytes
From: reinier@pugsley
To: help-gcc@prep.ai.mit.edu
Cc:
Date: Wed Sep 29 17:09:47 1993
Subject: GNU C++ Exception handling
PostBoxID v02.0-061-000350133
Hello help-gcc,
I would like to find out how to use the exception handling mechanism supported by GNU C++.
We use GCC 2.4.5 configured for i386-unknown-sco3.2v4.0 (and at home on i386-unknown-linux).
The GDB Info page reads under the node <Exception Handling> "Some languages, such as GNU C++,
implement exception handling". The Info page for GCC however, makes no reference to this
feature. Looking at the source for GCC, I found the file cp-except.c which implements the
exception handling mechanism. Armed with the ARM I tried to implement the following test:
#include <iostream.h>
void f()
{
throw("Help");
}
main()
{
try
{
f();
}
catch (const char* p)
{
cerr << "catch : " << p << endl;
}
}
When I compiled this with "c++ -g -c except.cc", it said that "throw" and "try" were undeclared
and "catch" was thought to be a function.
Can I use the GNU C++ exception handing in our configuration, and if so, could you please provide
me with a simple example on how to use it?
Many Thanks,
Reinier Lolkema
====================================================================================
,-_|\ Sofware Design Engineer MHSnet : reinier@pugsley.neclte.necisa.oz.au
/ \ NEC Australia Pty. Ltd.
\_,-._/ 649-655 Springvale Road Phone : +61 3 264 3037
v Mulgrave, Victoria 3170 Fax : +61 3 264 3892
====================================================================================
Technical Details
Message-ID:
<199309290713.AA24820@metro.ucc.su.OZ.AU>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!emory!nigel.msen.com!sdd.hp.com!vixen.cso.uiuc.edu!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!neclte.necisa.oz.AU!reinierShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,753c15c5c16de1cc,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-09-29 01:02:44 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!sol.ctr.columbia.edu!emory!nigel.msen.com!sdd.hp.com!vixen.cso.uiuc.edu!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!neclte.necisa.oz.AU!reinier From: reinier@neclte.necisa.oz.AU (reinier) Newsgroups: gnu.gcc.help Subject: (none) Date: 29 Sep 1993 03:18:03 -0400 Organization: GNUs Not Usenet Lines: 53 Sender: daemon@cis.ohio-state.edu Distribution: gnu Message-ID: <199309290713.AA24820@metro.ucc.su.OZ.AU>