3 ms·
Wait does C now have try/catch?
by tomcam 5y ago
Wait does C now have try/catch?
- basementcat 5y agoIt’s called setjmp() and longjmp(). https://web.archive.org/web/20091104065428/http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html https://web.archive.org/web/20091104065428/http://www.di.uni...
- tptacek 5y agoIt has setjmp and longjmp, so yeah.
- kragen 5y agoAs you are well aware, calling setjmp and longjmp doesn't make code non-position-independent in the way that Raymond is talking about, because setjmp saves the return address with which it was actually called. It doesn't rely on PC tables in the executable the way that (a common implementation of) C++ exception handling does. I mention this not to inform you of it (you already understand it better than I do) but to keep anyone else reading the thread from being misled.
- tomcam 5y agoYeah like me. That was my understanding but I thought perhaps C had snuck in some high level exception handling that I didn’t know about.
- skim_milk 5y agoTechnically the code being uploaded is compiled from C++ as the rest of the project is written in C++. Kind of similar to the article but in my case all I'm doing is calling a bunch of C library functions from the shellcode.