4 ms·
>That and I print out error diagnostics, the location of the error at the time, and the errno. These macros probably saved me a good decade of time finding erro
by cube13 14y ago
>That and I print out error diagnostics, the location of the error at the time, and the errno. These macros probably saved me a good decade of time finding errors in C.
Line number and file macros are freaking awesome. Out of everything on that page those should be the major takeaway for the reader.
I also think it would be a good idea to add some context to why the goto is so useful in those examples. If any of the checks fail, you're in a full-stop, stick-a-fork-in-us-we're-done error state. Since you know that the function's operations have failed, and that you should be cleaning up everything immediately, goto is the right choice.