From: James Turner Date: Tue, 12 Jan 2016 18:50:31 +0000 (-0600) Subject: Fix many clang errors in UIUC code X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c62b0044380eb0387c447cc33660f74b02cbbce4;p=flightgear.git Fix many clang errors in UIUC code - because uiuc_warning_error always called exit(-1), it can be marked no return, so Clang realises that when it’s used in the ‘else’ side of a parsing test, uninitialised variables in the enclosing call site are safe. (Requires Simgear update to define SG_NO_RETURN helper) --- diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp index 50866ad14..b8213363e 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.cpp +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.cpp @@ -118,6 +118,9 @@ void uiuc_warnings_errors(int errorCode, std::string line) exit(-1); break; } + + cerr << "UIUC UNKNOWN ERROR" << endl; + exit(-1); } // end uiuc_warnings_errors.cpp diff --git a/src/FDM/UIUCModel/uiuc_warnings_errors.h b/src/FDM/UIUCModel/uiuc_warnings_errors.h index 62640bb47..ad9aac61b 100644 --- a/src/FDM/UIUCModel/uiuc_warnings_errors.h +++ b/src/FDM/UIUCModel/uiuc_warnings_errors.h @@ -6,6 +6,6 @@ #include #include -void uiuc_warnings_errors(int errorCode, std::string line); +SG_NO_RETURN void uiuc_warnings_errors(int errorCode, std::string line); #endif //_WARNINGS_ERRORS_H_