title: Is it a good idea to eliminate compiler warnings?
body: <p>In the past I've worked with -Wall and other switches for gcc to eliminate every compiler warning for projects I've been involved in.  Similarly, in Perl, I always program with use strict and use warnings (and often -T as well) to try to achieve the best code quality I can.  I understand that a few years ago, the Perl porters group worked hard to make perl itself (the Perl interpreter) compile cleanly under gcc with all warnings enabled. Obviously they felt that was a good idea for code quality.  I also understand that nowadays Perl programmers have been adding even more warnings to their code with Perl::Critic, which warns them when they violate best practices found in Damian Conway's Perl Best Practices book (and from other sources, I believe).</p>
  
  <p>I always had a good feeling about code that I had cleaned up this way, but sometimes I couldn't avoid the feeling that some of the work was a little wasted.  For example, in my intro C classes over a decade ago, I was taught to start my main() function like this:</p>
  
  <pre><code>void main(void) {
  </code></pre>
  
  <p>This was minimal and could only be used when you weren't returning a value and weren't accessing your arguments.  It works just fine in that case, but gcc warnings would let you know that this function really ought to look like:</p>
  
  <pre><code>int main(int args, char* argv) {
  </code></pre>
  
  <p>I must've typed a couple of hundred unused int args, char* argv lines back in the day.  Did I really make my code better, or just wear my fingers down shorter?</p>
  
  <p>Nowadays I'm programming in Java in Eclipse, and our project has tens of thousands of warnings.  I'd like to clean them up.  Some of them are especially difficult to understand and eliminate, but slowly I'm learning.  A few of these I've had to handle with compiler directives to suppress warnings (usually in tiny minimal methods to factor out the bad practice of ignoring warnings), but I'm finding ways to handle those, as well.</p>
  
  <p>Is this worth a programmer's time?  Will a project really be much better if you track down every single compiler warning?</p>
  
  <p>If nothing else, it seems like it'd be nice to reduce the number of warnings to zero so that serious warnings wouldn't get lost in the mess.</p>
  
  <p><strong>Note</strong>: Duplicate of <a href="https://stackoverflow.com/questions/183788/c-c-compiler-warnings-do-you-clean-up-all-your-code-to-remove-them-or-leave">this question</a></p>