Mail Archives: pgcc/1998/02/10/20:08:14
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 <iostream.h>
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! *
*****************************************************
- Raw text -