From e080c467eaa83e1933154229279f72b818f49805 Mon Sep 17 00:00:00 2001 From: dbj Date: Wed, 13 Nov 2019 11:19:06 +0100 Subject: [PATCH] had to give up on [[noreturn]] --- include/fmt/format.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 80702a3e..6bf5f8ad 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -72,23 +72,21 @@ #endif FMT_BEGIN_NAMESPACE -// terror == terminating error -[[noreturn]] inline void terror(const char msg_[BUFSIZ]) { +// +[[noreturn]] inline void fail_fast(const char msg_[BUFSIZ]) { ::puts("\n\n\nFast exit on {fmt} error with message: "); ::puts(msg_); ::perror("\nPOSIX error message: "); std::exit(EXIT_FAILURE); } namespace internal { - template -#ifndef FMT_EXCEPTIONS - [[noreturn]] -#endif - inline void do_throw(const Exception& x) { +template +inline void do_throw(const Exception& x) { #if FMT_EXCEPTIONS - throw x; + volatile bool b = true ; + if (b) throw x; #else - terror(x.what()); + fail_fast(x.what()); #endif } } // namespace internal