talbii / tal.bi

https://tal.bi/
1 stars 1 forks source link

https://blog.tal.bi/posts/exceptions-in-c/ #20

Open utterances-bot opened 7 months ago

utterances-bot commented 7 months ago

Exception handling in C - Ido Talbi’s blog

different ways to add "exceptions" to C

https://blog.tal.bi/posts/exceptions-in-c/

tigran2008 commented 7 months ago

Wouldn't it make more sense to use thread_local for the third solution?

talbii commented 7 months ago

@tigran2008 Definitely! In fact, errno (the standard C library way of dealing with exceptions) is also thread local, with the only difference being that its an integer definitions in errno.h (for example, #define EINVAL 22 for exception 'invalid argument').

Thanks for commenting! 😸