Commit 604fb3001d

mlugg <mlugg@mlugg.co.uk>
2025-09-13 19:02:57
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.
1 parent e9c0d43
Changed files (1)
lib
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;
             };