如何在我的项目中发现c ++特定的选项/警告? 例如:Wshadow很常见,但Wreorder仅适用于c ++
$ gcc -Q --help=warnings | grep shadow
-Wintrinsic-shadow
-Wshadow [disabled]
$ gcc -Wshadow -Q --help=warnings | grep shadow
-Wintrinsic-shadow
-Wshadow [enabled]
$ gcc -Wreorder -Q --help=warnings | grep reorder
cc1: warning: command line option ‘-Wreorder’ is valid for C++/ObjC++ but not for C
-Wreorder [disabled] !!! unexpectedly (not true) !!!
尝试gcc -x c++
或--help=warnings,c++
但没有效果。
由于