Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Treat warnings as errors" is a standard best practice.


> "Treat warnings as errors" is a standard best practice.

It's a good general practice, as long as exceptions can be made.

Some compiler warnings are rooted in the compiler being unable to prove something that is actually true.


Treat warnings as errors is terrible practice.


It's the only sane thing to do.

And everybody who doesn't do so really deserves the pain that results later on.


No it's completely insane because you never know what a different or future compiler is going to decide to bitch about.


A different or future compiler is going to "bitch" about more bugs in your code.

But I see, you're not interested in correcting the bugs you produce. You obviously prefer the "three-monkeys solution" to correctness problems.


What is the point of having warnings then.


You can suppress them in the rare cases this is needed.

Such suppression are than big warning signs in the code telling you that something exceptional is going on which needs extra attention when touched.

Also warnings may be wrong. Errors mustn't be and can't be as strict as warnings therefore.

But it shouldn't be possible to "just ignore them". If you do, this needs to be done deliberately and explicitly.


Yeah at best you can force can force people unfamiliar with the code to waste their time suppressing a dumb ass warning that means nothing. Or worse accidentally introduce a bug.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: