-vet... flags as warnings instead of errors

Is there some trick to get the Odin compiler to print the problems that it detects because of the -vet... switches that are applied but to print those as warnings and continue compiling, instead of as errors?

I have been fighting with it for a while and I seemingly can get it to ignore the issues entirely (i.e. just don’t give it the -vet... flags at all) or promote them all the way to errors that halt the build.

I’m all for having these as errors for production or automated testing or C.I. or just about any environment that isn’t development time, debug work but – heck! – they’re so annoying when one is actually trying to write some code.

Particularly ones like unused imports: I’ll deal with it. Later. I promise!

But I don’t just want to disable all the -vet... flags while I’m working and set myself up for The Nasty Surprise when it comes time to want to commit some work: then needing to discover how many I have and fix them – likely in a hurry – without any forewarning.

1 Like

++

i’d also like for it to be warnings instead of errors

actually tbh i can’t think of a single ‘warning’ that odin compiler throws

1 Like

A disabled @(init) procedure is a warning.

Oversized stack variables (256 KiB+) are also a warning, as is using a bit_field with only bool fields.

In general though, the Odin compiler follows a similar to philosophy to that of Go: no warnings, only errors. The few warnings that exist are more info-level than warning-level, but at the same time there’s no way to actually disable them, so IMO they might as well be errors anyway.

1 Like

The worst is Zig. I’ve been evaluating a tonne of newer languages in the past few months, including Odin, C3, D (not all that new) and Zig and Odin is currently winning just because I find myself truly enjoying coming back to it after every other thing I try out.

For me, Zig’s insistence that everything is an ERROR makes it have absolutely no place in my skill-set because, if the language is going to be so full of friction as to be painful for experimentation, prototyping and exploring new ideas, I’d rather just write Rust which is infinitely more stable, better supported and better documented. I know Rust; the borrow checker is a known adversary. Why would I bother learning a new language that’s just as painful but in different ways?

Odin, however, presents the perfect compliment to Rust in my skill-set because it is lovely for trying out new things, experimentation, rapid prototyping and exploring problem-domains and also fully featured such that I could realistically imagine progressing those projects without having to start over, should they graduate from prototype to product. (Within reason.)

But having some of those -vet… flags as warnings (instead of just turning them off, completely, which is what I do, today, of course) would be so greatly useful to me in that prototyping stage, as I wrote in my OP.

And it would be categorically superior to Zig’s stance.

1 Like

I could add -vet-as-warning or something, it’s usually better to make it an error most of the time because people are using that as a way to adhere to whatever the -vet operation is doing.