Re:Why should I have written ZeroMQ in C, not C++ (2012)
by dkrikun on Thursday December 13, 2018 @01:14AM
(#18670233)
There are certain widely accepted norms on how to handle errors in C. It is best to restrain ourselves to "prior art" so that your code is immediately comfortable to read and use for a seasoned C dev.
To list a few: return codes, errno and longjump
[ Parent
| on HN ]
Re:Why should I have written ZeroMQ in C, not C++ (2012)
by int_19h on Thursday December 13, 2018 @06:21AM
(#18671477)
Don't use setjmp/longjmp unless you can guarantee that you own all frames between one and the other (i.e. don't use it as a public error reporting API in a library, for example). They don't play well with C++, and really anything else that needs to unwind the stack. Those who write R extensions in C++ know how messy it can be.
Re:Why should I have written ZeroMQ in C, not C++ (2012)
by SamReidHughes on Thursday December 13, 2018 @09:02AM
(#18672333)
The only widely accepted one in that list is return codes.