aboutsummaryrefslogtreecommitdiff
path: root/lib/std/start.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-09-13 18:02:57 +0100
committermlugg <mlugg@mlugg.co.uk>2025-09-30 13:44:54 +0100
commit604fb3001d6480d1687ddeb988c64c8028d5e55a (patch)
treefb521a1b95ff0ac10a6657f39845cd18cdf906c4 /lib/std/start.zig
parente9c0d43c5b6fc5065ac2e22e162b7d7476f5097d (diff)
downloadzig-604fb3001d6480d1687ddeb988c64c8028d5e55a.tar.gz
zig-604fb3001d6480d1687ddeb988c64c8028d5e55a.zip
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 (limited to 'lib/std/start.zig')
-rw-r--r--lib/std/start.zig7
1 files 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;
};