title: How do I get missing prototype warnings from g++?
body: <p>I currently have a project that uses g++ to compile it's code.  I'm in the process of cleaning up the code, and I'd like to ensure that all functions have prototypes, to ensure things like const char * are correctly handled.  Unfortunately, g++ complains when I try to specify -Wmissing-prototypes:</p>
  
  <pre><code>g++ -Wmissing-prototypes -Wall -Werror -c foo.cpp
  cc1plus: warning: command line option "-Wmissing-prototypes" is valid for Ada/C/ObjC but not for C++
  </code></pre>
  
  <p>Can someone tell me:<br>
    1) Why does gcc this isn't valid?  Is this a bug in gcc?<br>
    2) Is there a way to turn on this warning?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here's a cut and paste example:</p>
  
  <pre><code>cat &gt; foo.cpp &lt;&lt;EOF
  void myfunc(int arg1, int arg2)
  {
      /* do stuff with arg1, arg2 */
  }
  EOF
  g++ -Wmissing-prototypes -c foo.cpp  # complains about not valid
  g++ -c foo.cpp                       # no warnings
  # Compile in C mode, warning appears as expected:
  g++ -x c -Wmissing-prototypes -c foo.cpp
  </code></pre>