Hacker News new | ask | show | jobs
by shabble 4654 days ago
I believe they mean that

    if (foo = 0) ...
generates a warning like this:

    warn.c:2: warning: suggest parentheses around assignment used as truth value
which you should be paying attention to, in favour of yoda-comparisons in this particular holy war :)
2 comments

The code in question (see the LWN link elsewhere in this discussion) actually had parens around the expression (in a context where they looked "normal") and wouldn't have generated a warning.

That said, I agree with huhtenberg above that twisting the language conventions around to deal with this is never going to fix anything. Subtle code remains subtle in all languages, and subtle code is where security bugs lie. You can't fix "subtle" with a rulebook.

I would but if you see the rest of the thread, my gcc isn't raising this as a warning!

That in itself is sign that a mistake can be made without noticing.