Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using GCC 4.8 64bit with SEH on Windows

10 views
Skip to first unread message

Ali

unread,
Jan 22, 2015, 11:04:00 PM1/22/15
to Help-gp...@gnu.org
I have searched on the forums and didn't find any information on how to
enable Structured Exception Handling in GCC 4.8.2 64 bit.I am using windows
8.

Here is my code:
#include <iostream>
int main(){
try{
std::string *str=new std::string("hello");
str=0; //null is assigned intentionally so to check exception
std::cout<<str->size();//should generate exception instead of crashing
}
catch(std::exception ep){
std::cout<<"unhandled Exception caught";//never reaches here
}
}
The program is compiled simply as g++ -m64 test.cpp -o test.exe
The expected output of the above program is "Unhandled exception caught",
but in actual it simply crashes which means the try catch clause is not
working.
So is it that GCC 4.8 (64bit) doesn't support full SEH yet or there is
something else I am missing.
Any help would be appreciated.



--
View this message in context: http://gcc.1065356.n5.nabble.com/Using-GCC-4-8-64bit-with-SEH-on-Windows-tp1113576.html
Sent from the gcc - Gnu Help List mailing list archive at Nabble.com.

0 new messages