commit 604fb3001d6480d1687ddeb988c64c8028d5e55a (tree)
parent e9c0d43c5b6fc5065ac2e22e162b7d7476f5097d
Author: mlugg <mlugg@mlugg.co.uk>
Date: Sat, 13 Sep 2025 18:02:57 +0100
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.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git 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;
};