3 ms·
Awesome would be something outside the box or rather, outside the function scope. Of course, using longjmp is not much more novel today than using this approach
by sovande 11y ago
Awesome would be something outside the box or rather, outside the function scope. Of course, using longjmp is not much more novel today than using this approach which is tried and ugly. I find that a mix of classic return tests and longjmp in exceptional cases makes for the easiest error handling in C. David Hanson, among many others, has a much better set of awesome macros for exactly this; https://github.com/drh/cii/blob/master/include/except.h https://github.com/drh/cii/blob/master/include/except.h
- MonkeyIsNull 11y agoAbsolutely! C Interfaces and Implementations should be read by anyone coding C these days. Absurd how little known it is though.