Hacker News new | ask | show | jobs
by colanderman 4653 days ago
Or run a linter or static checker which disallows assignments in conditionals as part of your build and/or checkin process. They'll catch this and other fun C "gotchas" without relying on human vigilance.
1 comments

That's the failsafe (one I believe heavily in as well). But getting it right up front is still the best approach.