News for hackers. Stuff that matters.
Re:I like Odin by jcelerier on Sunday August 28, 2022 @05:21PM (#32632174)
no, those are absolutely not fixes: you have to remember to use "using", "with", etc. whereas you have to go out of your way to circumvent RAII
Re:I like Odin by baq on Sunday August 28, 2022 @06:20PM (#32632638)
Non-issue. You can use fopen in C++ and remember to fclose, too.
Re:I like Odin by jcelerier on Monday August 29, 2022 @01:58AM (#32635169)
No, every time you have something that sound like "you just have to [...]" it means future bugs that were entirely preventable. The only correct way in c++ is to wrap it in a unique_ptr or handle type so that fclose gets called automatically when you are done with the resource
Re:I like Odin by pjmlp on Monday August 29, 2022 @03:37AM (#32635610)
Use static analysers, just like you have to do on C and C++ to handle many of their flaws.