News for hackers. Stuff that matters.
Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by Arech on Tuesday August 06, 2024 @01:11PM (#41172873)
but to me these are - again - a user induced problems. I'm interested if a user doesn't do stupid things, should they still afraid that a standard extern C code could throw? Say, std::sprintf() which if I'm not mistaken boils down to C directly? Are there cases where C std lib could throw without a "help from a user"?
Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by leni536 on Tuesday August 06, 2024 @04:06PM (#41174761)
https://eel.is/c++draft/res.on.exception.handling#2

I general functions from the C standard library must not throw, except for the ones taking function pointers that they execute.

Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by Arech on Wednesday August 07, 2024 @06:32AM (#41179925)
perfect again, thank you!
Re:C++'s `Noexcept` Can (Sometimes) Help (Or Hurt) Performance by tsimionescu on Wednesday August 07, 2024 @06:27AM (#41179896)
I don't think anything in the C parts of the C++ standard library throws its own exceptions. However, it's not completely unreasonable for a third party C library to use a C++ library underneath, and that might propagate any exceptions that the C++ side throws. This would be especially true if the C library were designed with some kind of plugin support, and someone supplied a C++ plugin.