Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have actually seen code like this in production. A "senior engineer" I worked with decided that C++ DOM parsing code was too verbose with so many checks for null child nodes, so he wrote a set of macros which wrapped setjmp/longjmp and trapped SIGSEGV to allow resuming any code that tried to traverse a null pointer.

If of course made debugging effectively impossible, not to mention catching all segfaults, not just those triggered by a DOM parsing error.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: