title: Why is gcc's option "-Wstrict-prototypes" not valid for C++?
body: <p>Here is a warning I, and lots of people out there on the web, see when running gcc on C++ code:</p>
  
  <pre><code>cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
  </code></pre>
  
  <p>The warning text is very clear: 'C++' is not in the set [Ada/C/ObjC ], so I have no question at all about why gcc gives this warning when compiling C++ code. (FYI the reason we have this flag turned on in spite of having C++ code is because it's mostly C code, we have chosen a strict (high level of) warning options list, but we've added a bit of C++ code.</p>
  
  <p>My question is: Why isn't this warning valid for C++?</p>
  
  <p>The gcc documentation for the warning option, from <a href="http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Warning-Options.html" rel="nofollow">http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Warning-Options.html</a>, is:</p>
  
  <blockquote>
    <p>-Wstrict-prototypes (C and Objective-C only) Warn if a function is declared or defined without specifying the argument types. (An
    old-style function definition is permitted without a warning if
    preceded by a declaration which specifies the argument types.)</p>
  </blockquote>
  
  <p>Now I just <em>know</em> I'm forgetting something obvious about C++, but doesn't C++ also require specifying argument types for functions in a prototype? True that those function prototypes are often in class declarations because the functions are often member functions, but aren't prototypes nevertheless required? Or even if they're just good practice, then why wouldn't gcc offer support by this option? Or if not, by a parallel option for C++?</p>