Hacker News new | ask | show | jobs
by zabzonk 1777 days ago
Under the hood of GCC specifically.
2 comments

That's the article I used when I implemented exceptions in an LLVM-based compiler, so it's applicable to more than just GCC.
Is your work public? If my article was useful, I'd love to have a look at what you did!
It's public, but I doubt it still compiles against recent LLVM versions! I started it 8 years ago to get a better understanding how features like classes & operator overload would work in a JS-like language. It was really fun!

https://github.com/castel/libcastel/blob/master/runtime/sour...

https://github.com/castel/libcastel/blob/master/runtime/sour...

I remember that at the time there were very few resources on personality functions, even in the LLVM doc - I had to make a lot of research before finding your articles, which were extremely helpful!

I got reminded of them yesterday after someone pinged me on a Stack Overflow answer I made at the time, asking for an updated link; after I found your long-form article I figured it would be a good topic for HN as well :)

https://stackoverflow.com/questions/16597350/what-is-an-exce...

ahhh, I see you got hit by some of the fallout of my migration from Wordpress to Blogspot. Sorry about that!

I tried to set http301s but gave up when I had to pay for it :)

Doesn't GCC support multiple exception handling options?
I'm not sure exactly what you mean but there was a switch to DWARF EH ages ago (GCC 2?)
sjlj is still supported, at least on some platforms, e.g. MinGW.
I'm not sure what your point is - mine was that the original post is specifically about GCC, not Standard C++.
“Standard C++” just specifies `throw` and `catch` (plus what happens when you traverse a block, nothrow declaration etc)

Every implementation has to do something to actually be standard C, and this is an example. It’s rather similar on other hardware, but as far as the standard goes that is irrelevant.

Mainly that exception handling doesn't have a single solution, even in GCC. I'm agreeing with you that this article only highlights one version of exception handling for one compiler.

There's also potential operating system involvement that's not really covered in this article.