1
0
Fork 0

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)
This commit is contained in:
James Turner 2016-01-12 12:50:31 -06:00
parent dc17b5dda2
commit c62b004438
2 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -6,6 +6,6 @@
#include <string>
#include <cstdlib>
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_