title: gcc switch -Wc++0x-compat is being used for C code
body: <p>I'm trying to use as much gcc warning switches as possible to ascertain whether they help make my code cleaner or even find problems.</p>
  
  <p>I'm using these warning switches for C:</p>
  
  <pre><code>warnings_common = ['-Werror', '-Wfatal-errors', '-Wpedantic', '-pedantic', '-pedantic-errors', '-Wall', '-Wextra', '-Wchar-subscripts', '-Wcomment', '-Wno-coverage-mismatch', '-Wno-cpp', '-Wdouble-promotion', '-Wformat', '-Wnonnull', '-Winit-self', '-Wimplicit-int', '-Wimplicit-function-declaration', '-Wimplicit', '-Wignored-qualifiers', '-Wmain', '-Wmissing-braces', '-Wmissing-include-dirs', '-Wparentheses', '-Wsequence-point', '-Wno-return-local-addr', '-Wreturn-type', '-Wswitch', '-Wswitch-default', '-Wswitch-enum', '-Wsync-nand', '-Wtrigraphs', '-Wunused-but-set-parameter', '-Wunused-but-set-variable', '-Wunused-function', '-Wunused-label', '-Wunused-local-typedefs', '-Wunused-parameter', '-Wno-unused-result', '-Wunused-variable', '-Wunused-value', '-Wunused', '-Wuninitialized', '-Wmaybe-uninitialized', '-Wunknown-pragmas', '-Wno-pragmas', '-Wstrict-aliasing', '-Wstrict-overflow', '-Warray-bounds', '-Wno-div-by-zero', '-Wsystem-headers', '-Wtrampolines', '-Wfloat-equal', '-Wtraditional', '-Wtraditional-conversion', '-Wdeclaration-after-statement', '-Wundef', '-Wno-endif-labels', '-Wshadow', '-Wno-free-nonheap-object', '-Wunsafe-loop-optimizations', '-Wno-pedantic-ms-format', '-Wpointer-arith', '-Wtype-limits', '-Wbad-function-cast', '-Wc++-compat', '-Wc++11-compat', '-Wcast-qual', '-Wcast-align', '-Wwrite-strings', '-Wclobbered', '-Wconversion', '-Wempty-body', '-Wenum-compare', '-Wjump-misses-init', '-Wsign-compare', '-Wsign-conversion', '-Wsizeof-pointer-memaccess', '-Waddress', '-Wlogical-op', '-Waggregate-return', '-Wno-aggressive-loop-optimizations', '-Wno-attributes', '-Wno-builtin-macro-redefined', '-Wstrict-prototypes', '-Wold-style-declaration', '-Wold-style-definition', '-Wmissing-parameter-type', '-Wmissing-prototypes', '-Wmissing-declarations', '-Wmissing-field-initializers', '-Wno-multichar', '-Wno-deprecated', '-Wno-deprecated-declarations', '-Wno-overflow', '-Woverride-init', '-Wpacked', '-Wpacked-bitfield-compat', '-Wpadded', '-Wredundant-decls', '-Wnested-externs', '-Winline', '-Wno-int-to-pointer-cast', '-Wno-pointer-to-int-cast', '-Winvalid-pch', '-Wlong-long', '-Wvariadic-macros', '-Wvarargs', '-Wvector-operation-performance', '-Wvla', '-Wvolatile-register-var', '-Wdisabled-optimization', '-Wpointer-sign', '-Wstack-protector', '-Woverlength-strings', '-Wunsuffixed-float-constants']
  </code></pre>
  
  <p>but I'm getting this error:</p>
  
  <pre><code>cc1: error: command line option '-Wc++0x-compat' is valid for C++/ObjC++ but not for C [-Werror]
  </code></pre>
  
  <p>which seems strange since I'm compiling a C file:</p>
  
  <pre><code>int main(void);
  
  int main(void) {
    return 0;
  }
  </code></pre>
  
  <p>Which switch from the above is calling '-Wc++0x-compat' and why?</p>