Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a gcc option to assume all extern "C" functions cannot propagate exceptions?

Is there any way, short of putting an attribute on each function prototype, to let gcc know that C functions can never propagate exceptions, i.e. that all functions declared inside extern "C" should be __attribute__((nothrow))? Ideal would be a -f style command line option.

like image 263
R.. GitHub STOP HELPING ICE Avatar asked Jan 14 '11 20:01

R.. GitHub STOP HELPING ICE


1 Answers

You can always use -fno-exceptions which will ensure that the c++ compiler does not generate exception propagation code.

like image 122
doron Avatar answered Oct 08 '22 12:10

doron