Hacker News new | ask | show | jobs
by DrJokepu 4797 days ago
I never really understood this, what's stopping you from resolving those warnings even if they won't make the build fail? I mean, you still get a list of all the warnings and you can still have a zero-warnings rule (which is something you should really do)? This is, in my opinion, exactly as pointless as my wife setting her alarm clock seven minutes forward in order to stop herself from being late.
3 comments

There are two scenarios. In one, you control the build process yourself, in which case nothing is physically stopping you. There is still value in doing it, because we are irrational creatures. We may be more likely to let a "warning" slide, rather than an "error," even though it is only classified as an error because we told it to do so. Being irrational creatures, we are loathe to go back on past decisions, and turning an "error" back into a "warning" requires action on our part that implies we were wrong before. We're more likely to just fix the "error."

The second situation is when you don't control the build process, in which case someone or someones are keeping you honest.

Have you ever tried to spot a warning in a large project with hundreds of files? It's nearly impossible as all those build commands fly by. Note that I'm speaking to a more traditional Unix Make environment. Therefore, it's easier to fail on that specific file than to let the build continue.

Certainly building with a tool like Xcode makes the warnings more conspicuous, and you can just choose to fix all warnings. I don't see anything wrong with that approach, but I still prefer to just treat the warnings as errors. I guess it's just how I'm built.:)

Warnings are output to stderr. Personally I just do this: make > /dev/null

All that you see after that are warnings and errors.

When I build a program with make, the warnings are very easy to spot. While you do, without warnings, see a bunch of text fly through the screen, all of that text looks incredibly simmilar. Warnings (and errors) stick out in the wall of text.
I guess we've just had different experiences. I can say from experience, without a doubt, that I could not possibly pick out a warning among hundreds of compile/link commands.

Now, if dependencies were in order, and I'd just made a small change to a single file, and had previously built the project successfully, I'm sure I could probably catch a single warning. That's a lot of assumptions to work from. I prefer to let the build fail.

I'd compare it to disabling the snooze button.