-
Recent Posts
Recent Comments
Categories
Links
Daily Archives: August 11, 2017
gcc turn off exceptions:-fno-exceptions
在g++編譯時,程式若為了效能考量可能希望減少執行時對exception機制的overhead,可用-fno-exceptions 這個選項關掉exception 但此時就無法使用try catch 可用 #if __cpp_exceptions 來做處理, 或是使用c processor的predefined macro https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html __EXCEPTIONS This macro is defined, with value 1, when compiling a C++ source file with exceptions enabled. If -fno-exceptions is used when compiling the file, then this macro … Continue reading
Posted in Tips
Leave a comment