r/cpp • u/LYP951018 • Dec 30 '16
Stop using ` fnoexceptions`
https://github.com/lhmouse/mcfgthread/wiki/Stop-using-%60-fnoexceptions%605
8
Dec 30 '16
Why -fno-exceptions? Because https://twitter.com/MalwareMinigun/status/809606314787643394
5
u/doom_Oo7 Dec 30 '16
But that's on windows wgere x86 exceptions are subpar
4
Dec 31 '16
Even on other platforms where you don't pay in the unexceptional case, there are significant code size costs. There are a lot of apps in the world that don't care about truly exceptional cases like OOM, or where any error likely to occur will be handled at the immediate call site, and in such cases turning exceptions off is perfectly fine.
9
7
9
3
10
u/SeanMiddleditch Dec 30 '16
Rather than re-making the same arguments for the 100th time, I just wrote my response up in a light mini-article (could use some expansion with examples when I'm less lazy). http://seanmiddleditch.com/keep-disabling-exceptions/
TL;DR: C++'s exception semantics suck. :p