1. 6
  1.  

  2. 7

    I think there’s a lesson here, but mining nuggets out of random email posts isn’t the best delivery mechanism.

    1. 1

      My attempt at interpreting the lession/question is: “discuss the pros and the cons of ‘fixing’ a compiler warning with a change to the code which is otherwise a no-op”.

      My take would be: yes, it is worth doing, since it allows you to focus on (and even error the build on) all warnings if you fix those which occur. Fixing in this sense is really just marking the code to say “this is fine, no need to warn on this” (and a comment as to why (along with the cast) would be a good idea).

      The cost is uglier code (cast and a comment), but if you don’t do this, the warnings which you might care about (= instead of == in an if() ?) will be harder to find, which I think is more important.