From c62b0044380eb0387c447cc33660f74b02cbbce4 Mon Sep 17 00:00:00 2001 From: James Turner Date: Tue, 12 Jan 2016 12:50:31 -0600 Subject: [PATCH] Fix many clang errors in UIUC code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - 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) --- src/FDM/UIUCModel/uiuc_warnings_errors.cpp | 3 +++ src/FDM/UIUCModel/uiuc_warnings_errors.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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_ -- 2.39.5