I've some C++ projects, which does not use exception handling.
What are the benefits of adding -fno-exceptions
, or does gcc figure out itself that I don't use exceptions(nor any libraries that uses exceptions) ?
I've some C++ projects, which does not use exception handling.
What are the benefits of adding -fno-exceptions
, or does gcc figure out itself that I don't use exceptions(nor any libraries that uses exceptions) ?
Probably minimal - the cost of an exception is mostly incurred if an exception is actually thrown. However, as usual the answer is to try it out and time it, which in this case would seem to be trivially easy. There are quite afew existing questions on this subject, such as http://stackoverflow.com/questions/691168/how-much-footprint-does-c-exception-handling-add.
The main difference is likely to be more in the size of the generated code than the speed of execution. You can obviously test it out to see what difference it makes, but if your interest is primarily in execution speed it probably won't make enough difference to notice or care about.