From ef8c9af400f937421b2c7a8230dc4fca2ec733b9 Mon Sep 17 00:00:00 2001 From: Tobias Hammer Date: Tue, 30 Jun 2020 10:18:51 +0200 Subject: [PATCH] Add comment to explain why std::fprintf --- include/fmt/format-inl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index aeb26b84..d57e5166 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -49,6 +49,8 @@ FMT_BEGIN_NAMESPACE namespace detail { FMT_FUNC void assert_fail(const char* file, int line, const char* message) { + // Use unchecked std::fprintf to avoid triggering another assertion when + // writing to stderr fails std::fprintf(stderr, "%s:%d: assertion failed: %s", file, line, message); // Chosen instead of std::abort to satisfy Clang in CUDA mode during device // code pass.