try/catch redefined as macros [message #997511] |
Mon, 07 January 2013 21:59 |
Ted Holzman Messages: 1 Registered: January 2013 |
Junior Member |
|
|
Hi,
I am using Eclipse Juno/CDT on a Mac OSX 10.7.5 system.
The following tiny program:
#include <iostream>
#include <exception>
using namespace std;
class myexception: public exception
{
virtual const char* what() const throw(){return "My exception\n";}
virtual ~myexception(){}
} myex;
int main () {
try {
throw myex;
} catch (exception& e)
{cout << e.what() << endl;}
return 0;
}
...compiles and runs under g++, but the e.what() expression generates a parse error in eclipse. On further analysis I discovered that "try" and "catch" had been redefined as macros. And on further further analysis, I discovered that this is only supposed to happen when -fno-exceptions is specified. On the furthest analysis I attempted, I discovered that the system macro __EXCEPTIONS *was* defined, but seemed to be ignored.
Can anybody help me coerce eclipse to treat try and catch as keywords and not macros?
Or point me in the direction of the proper parts of the manual?
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.02683 seconds