X-pop3-spooler: POP3MAIL 2.1.0 b 3 961213 -bs- Delivered-To: pcg AT goof DOT com Message-Id: <3.0.16.19980210204353.35c74038@hem1.passagen.se> X-Sender: blizzar AT hem1 DOT passagen DOT se (Unverified) X-Mailer: Windows Eudora Pro Version 3.0 (16) Date: Tue, 10 Feb 1998 20:43:58 -0500 To: andrewc AT rosemail DOT rose DOT hp DOT com From: Peter Palotas Subject: Re: PGCC for DOS and exception handling!? Cc: beastium-list AT Desk DOT nl Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: Marc Lehmann Status: RO Content-Length: 1535 Lines: 67 At 10.25 1998-02-10 PST, you wrote: >> Doesn't EGCS-1.0.1 support exceptions when ported to DOS (or at all)? >Uh - exception handling? Whats that? Well, it's a c++ feature for easier "error-handling" or "exception-handling". >> Whenever a program throws an exception my program exits with the "Abort!" >> message! >> (The same program works fine with GCC 2.8.0 under linux). >Can you put together a small source sample for me to try? I really >don't know c++ (I assume this is c++ we are talking about) at all. Yes, you are correct, it's c++. Here's the source I compiled: #include void f(int x) throw(int) { if (x > 10) throw(x); cout << "f: " << x << endl; } int main(void) { try { f(5); f(9); f(11); } catch(int i) { cout << "Error: Argument to f() was too large (" << i << ")" << endl; } return 0; } When compiled with the PGCC release based on EGCS 1.0.1 the output is the following: f: 5 f: 9 Abort! i.e. when the exception are thrown as 11 is passed to f(), I just get the abort message. When compiled with GCC 2.8.0 (under linux) the output is the following: f: 5 f: 9 Error: Argument to f() was too large (11) i.e. the expected output (atleast what I expected). Greatful for any replies. -- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se -- ***************************************************** * A brief description of DJGPP: * * NEVER BEFORE HAS SO FEW DONE SO MUCH FOR SO MANY! * *****************************************************