Well try catch compile, link and work ok when l=nt is used, however when l=dos4g is used the jolly old ___wcpp_4_fs_ha ndler_ comes up as an undef with an additional warning of __compiled_unde r_NT as an undef too, however only the handler is the "final" undef being referenced out of plbx3r.lib(FSHA ND).
This problem occurs going all the way back to OW 1.2 strangely it does not occur for watcom 10.6
I have tried to stick in all the ex... headers but to no avail. When linked as nt or dos4g(watcom 10.6) no extra header files are required anyway.
Here is a simple program that will demo the aggravation:
Anyone any ideas?
This problem occurs going all the way back to OW 1.2 strangely it does not occur for watcom 10.6
I have tried to stick in all the ex... headers but to no avail. When linked as nt or dos4g(watcom 10.6) no extra header files are required anyway.
Here is a simple program that will demo the aggravation:
Code:
#include <iostream.h>
int divide(int divisor, int dividend) throw (const char*)
{
if (dividend == 0)
throw (const char*)"Division by zero attempted";
// Here we don't have to worry about dividend being zero
return divisor/dividend;
}
int main(void)
{
try {
int result = divide(50,2);
cout << "divide(" << 50 << ", " << 2
<< ") yields " << result << endl;
result = divide(50,0);
cout << "divide(" << 50 << ", " << 0
<< ") yields " << result << endl;
}
catch (const char* msg) {
cout << "Oops, caught: " << msg << endl;
}
return 0;
}