diff --git a/samples/hello/hello-baseline.cpp b/samples/hello/hello-baseline.cpp index a972ee7..fd465ef 100644 --- a/samples/hello/hello-baseline.cpp +++ b/samples/hello/hello-baseline.cpp @@ -176,7 +176,11 @@ std::string BaselineCheck::failText(std::uint64_t emitted) const { "\n run: " + lineB_; } if (emitted != baseline_.size()) { - const std::uint64_t at = std::min(emitted, baseline_.size()); + // Both arguments must be one type for std::min's template deduction: + // on platforms where uint64_t is not size_t (macOS: unsigned long + // long vs unsigned long) the mixed call is a hard compile error. + const std::uint64_t at = + std::min(emitted, static_cast(baseline_.size())); return "baseline stream length mismatch: the baseline has " + std::to_string(baseline_.size()) + " lines, the run produces " + std::to_string(emitted) + " (first missing/extra at tick " + diff --git a/src/laige-core/logging.cpp b/src/laige-core/logging.cpp index ab97043..4f702ff 100644 --- a/src/laige-core/logging.cpp +++ b/src/laige-core/logging.cpp @@ -497,7 +497,15 @@ namespace { // disposition (core dump / debugger / abort) continues unchanged. void crashHandler(int signum, siginfo_t*, void*) { static const char msg[] = "laige: fatal signal received; flushing logs\n"; - (void)write(STDERR_FILENO, msg, sizeof(msg) - 1); + // glibc declares write() with warn_unused_result (attached under + // fortification, i.e. optimized builds); a (void) cast does not + // suppress it, and the engine's -Werror makes it fatal. Consume the + // result instead — the notice is best-effort, and there is no + // async-signal-safe fallback if the write fails (LOG-007). + const ssize_t written = write(STDERR_FILENO, msg, sizeof(msg) - 1); + if (written == -1) { + // Intentionally empty: nothing else is async-signal-safe here. + } Logger::instance().crashFlush(); raise(signum); }