What is the benefit of using
It is possible to forbid usage of throw statements by providing certain options to the compiler. For GNU compiler (gcc) please usein conjunction with
Per the GCC documentation, it suppresses the generation of static unwind tables (as opposed to complete exception-handling code), the main benefit of which is likely to be smaller object files due to not containing that data. Note that such tables might be used for things like stack-walking code for backtrace generation even in the absence of full-blown exception-handling (e.g. in C code).
I don't know for sure, but I'd imagine that in the case where, by default, full exception-handling code is already disabled but static unwind tables are enabled,
-fno-exceptions probably doesn't affect the latter, hence using both options covers all bases. In other words, the compiler may want to generate one or the other, but when size and efficiency matter you definitely want it to do neither.