Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Doubt on rule 13.2
#4
But you are testing against zero, rather than NULL. The difference is subtle, and only a matter of coding style. This cannot cause any problems, but it can perhaps cause implicit typecast warnings.

I interpret the rule as "everything that isn't Boolean should be explicitly tested". Consider this:

if(!y)

If y is a pointer, this is surely poor coding style, since ! is a pure Boolean operator.
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)