From 4cbe6200d61ec035b5be3baa1100111b050f86ea Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 25 Apr 2021 21:02:01 -0400 Subject: [PATCH] correct declaration --- src/error.cpp | 2 ++ src/error.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/error.cpp b/src/error.cpp index a67a9e5865..a6aaf5a360 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -225,6 +225,7 @@ void Error::_all(const std::string &file, int line, fmt::string_view format, } catch (fmt::format_error &e) { all(file,line,e.what()); } + exit(1); // to trick "smart" compilers into believing this does not return } void Error::_one(const std::string &file, int line, fmt::string_view format, @@ -235,6 +236,7 @@ void Error::_one(const std::string &file, int line, fmt::string_view format, } catch (fmt::format_error &e) { one(file,line,e.what()); } + exit(1); // to trick "smart" compilers into believing this does not return } /* ---------------------------------------------------------------------- diff --git a/src/error.h b/src/error.h index cd42426501..36b36669a4 100644 --- a/src/error.h +++ b/src/error.h @@ -56,12 +56,13 @@ class Error : protected Pointers { std::string last_error_message; ErrorType last_error_type; +#endif + private: // internal versions that accept explicit fmtlib arguments [[ noreturn ]] void _all(const std::string &, int, fmt::string_view, fmt::format_args args); [[ noreturn ]] void _one(const std::string &, int, fmt::string_view, fmt::format_args args); -#endif }; }