From 604fb3001d6480d1687ddeb988c64c8028d5e55a Mon Sep 17 00:00:00 2001 From: mlugg Date: Sat, 13 Sep 2025 18:02:57 +0100 Subject: [PATCH] std.start: also don't print error trace targeting `.other` This only matters if `callMain` is called by a user, since `std.start` will never itself call `callMain` when `target.os.tag == .other`. However, it *is* a valid use case for a user to call `std.start.callMain` in their own startup logic, so this makes sense. --- lib/std/start.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/std/start.zig b/lib/std/start.zig index 13ce744a2a..60ddae43ac 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -635,10 +635,11 @@ pub inline fn callMain() u8 { else => {}, } std.log.err("{s}", .{@errorName(err)}); - if (native_os != .freestanding) { - if (@errorReturnTrace()) |trace| { + switch (native_os) { + .freestanding, .other => {}, + else => if (@errorReturnTrace()) |trace| { std.debug.dumpStackTrace(trace); - } + }, } return 1; };