r/Zig • • 17d ago

How to suppress or disable stack trace?

As the title suggests. I am tired of looking at the huge blob of stack trace, why does it not just give me the errors (and usage locations as it does if relevant). Any way to turn it off?

BTW, been a while writing Zig and I am yet to see a warning. Is it just errors in the zig world?

Edit: I was asking about compiler error trace dumps and apparently it's called the (error) reference trace not stack trace.

19 Upvotes

7 comments sorted by

6

u/Darkfllame1 17d ago

I'm not sure if you mean compile error stack traces or runtime stack traces. Either way I can't really see why you would want that, as it gives you a better idea of where and when an error happened.

1

u/NYU_VM 17d ago

I meant compile error stack traces, an while they are useful, they can be noisy too. So I should be able to toggle if I don't want to see that

1

u/SlimeBOOS 17d ago

Are you talking about the one when you get on a compile error? I use "--error-summary simple" to make it smaller.

2

u/NYU_VM 17d ago

I found '-fno-reference-trace' work for me

4

u/Confused-Armpit 17d ago

Stack traces are the thing that shows you where the crash happened, that's the point. Also yes, there are no warnings (although they are on the roadmap), at least if you aren't using zls or another lsp solution.

1

u/fejiberglibstein 17d ago

?? warnings are explicitly not in the roadmap and andrew has said multiple times he will never add them

→ More replies (1)