news
Programming Leftovers
-
Sandor Dargo ☛ What happens when a destructor throws
A destructor is the key to implementing the RAII idiom. RAII matters because after you acquire a resource, things might go south. A function might need to return early, or it might throw. Making sure resources are released is cumbersome, and the cleanest way to achieve it is to wrap both acquisition and release in an object that handles this automatically.
But what if the release itself is not successful?
-
Graham Sutherland ☛ Watch out for missed warnings on vendor C++ toolchains
I figure we’re overdue a security post on here, so here’s a quick one.
I was recently reviewing some embedded C++ for a lesser-used architecture. There is GCC support for the architecture, but the developers of the thing I was looking at utilise a vendor SDK which only compiles properly with the vendor’s own toolchain. It’s a security-sensitive thing so they turned up their compiler warnings and promoted them to errors, with something along the lines of: [...]
-
Perl / Raku