From 58eb2d7703d306195d8f563642f0ea17f50d4faa Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 4 May 2023 16:37:13 +0200 Subject: [PATCH] libc: Print failed assertions to stderr instead of stdout This removes two FIXMEs from the time there was no stderr. --- libc/src/assert.cpp | 3 +-- libluna/src/Check.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libc/src/assert.cpp b/libc/src/assert.cpp index f24110b6..c447945e 100644 --- a/libc/src/assert.cpp +++ b/libc/src/assert.cpp @@ -7,8 +7,7 @@ extern "C" { _weak [[noreturn]] void __assertion_failed(const char* file, int line, const char* function, const char* expr) { - // FIXME: Output to standard error instead of standard output. - printf("%s:%d: %s: Assertion '%s' failed.\n", file, line, function, expr); + fprintf(stderr, "%s:%d: %s: Assertion '%s' failed.\n", file, line, function, expr); abort(); } } diff --git a/libluna/src/Check.cpp b/libluna/src/Check.cpp index b4d1bcb4..edd1df74 100644 --- a/libluna/src/Check.cpp +++ b/libluna/src/Check.cpp @@ -6,7 +6,6 @@ _weak [[noreturn]] bool __check_failed(SourceLocation location, const char* expr) { - // FIXME: Output to standard error instead of standard output. - printf("Check failed at %s:%d in %s: %s\n", location.file(), location.line(), location.function(), expr); + fprintf(stderr, "Check failed at %s:%d in %s: %s\n", location.file(), location.line(), location.function(), expr); abort(); }