Reputation: 573
I need to get full Clang warnings list. With Descriptions. For iOS. I've seen just a list of warnings here Clang Warnings
But there is no description. Is there any place where i can get full list of Clang warnings with the description?
Upvotes: 10
Views: 16294
Reputation: 11823
(Note: This answer is now outdated.)
There's a neat project that shows the flags alongside their warning messages:
https://github.com/NSHipster/fuckingclangwarnings.com
While these are not comprehensive explanations in all cases, it is very helpful, especially when you want to switch off specific warnings.
The project hasn't been updated in a while and is probably missing a few new warnings. You could also dive into Clang's source code. I haven't worked with it in a while, but I can tell you where to start:
Clone the Clang repository
Browse to /include/clang/Basic/Diagnostic.td
. This file includes a couple of other .td
files which contain the various warnings, though I'm not sure if all of them are publicly available, and I think their external names are prefixed, depending on their category. I suggest searching for a known warning (or its description) to solve the puzzle.
Another interesting file is /include/clang/Driver/Options.td
, which includes the texts you get using the help
command, if I recall correctly.
Upvotes: 12
Reputation: 21
The [current] accepted answer is correct. clang/clang++'s documentation up on the website doesn't necessarily reflect the supported options in the code. As the old phrase goes, "the source code is the documentation" :/..
One thing that will help with finding options is grepping the source code for DiagGroup
. For example, the following demonstrates an attempt at grepping for sign-compare
, aka -Wsign-compare
, using a pared down clang 7.0.1 source checkout:
$ grep --include \*.td -r sign-compare . | grep DiagGroup
tools/clang/include/clang/Basic/DiagnosticGroups.td:def SignCompare : DiagGroup<"sign-compare">;
Upvotes: 1
Reputation: 201
I realize this is an old question, but a complete list of warnings, along with the text printed for each one, can be found in the Clang Documentation.
Upvotes: 18