3 ms·
out of curiosity, do people now use exceptions when programming on embedded? It's been 10 years years since I've really programmed embedded systems, but at the
by speedplane 8y ago
out of curiosity, do people now use exceptions when programming on embedded? It's been 10 years years since I've really programmed embedded systems, but at the time exceptions were a big no-no. It was often unclear how an exception would mess with the stack, how far up things would go, and what information was (and its size) being passed up.
Instead, we just checked return values of everything.
- proverbialbunny 8y agoExceptions are still a no-no for code that needs to be real time due to it's non-deterministic nature. The feature can be disabled with the -fno-exceptions flag. However, this might change in C++23. Herb Sutter just proposed C++ switch to deterministic exceptions. The paper is quite good: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p070... It looks popular, so there is a high chance it will become a thing allowing stl to work in the embedded world.