authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-09-13 18:02:57+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-09-30 13:44:54+01:00
log604fb3001d6480d1687ddeb988c64c8028d5e55a
treefb521a1b95ff0ac10a6657f39845cd18cdf906c4
parente9c0d43c5b6fc5065ac2e22e162b7d7476f5097d
signaturelock-open Commit is signed but in an unrecognized format.

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 files changed, 4 insertions(+), 3 deletions(-)

lib/std/start.zig+4-3
......@@ -635,10 +635,11 @@ pub inline fn callMain() u8 {
635635 else => {},
636636 }
637637 std.log.err("{s}", .{@errorName(err)});
638 if (native_os != .freestanding) {
639 if (@errorReturnTrace()) |trace| {
638 switch (native_os) {
639 .freestanding, .other => {},
640 else => if (@errorReturnTrace()) |trace| {
640641 std.debug.dumpStackTrace(trace);
641 }
642 },
642643 }
643644 return 1;
644645 };