Error/exception handling improvements.
- Change formatErrorMessage() to printFatalErrorMessage() that directly
prints the error message for an exception into a FILE (typically
stderr) instead of creating a std::string. This makes it possible to
handle out-of-memory errors internally within the function.
The function is much easier to use if we can guarantee that it never
throws.
- Add basic handling of std::bad_alloc into the above function.
- Resolve clang warnings in the function.
- Add a macro for conveniently catching all exceptions at C++ - C
boundary and reporting them as fatal errors.
- Initialize ProgramInfo in all C++ binaries.
Related to #838.
Change-Id: I77c355480485f563c57b6c6ea9b07a8ce7f433a8
14 files changed: