clangwarnings

Full Clang warning list with descriptions


I need to get the 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 the full list of Clang warnings with the descriptions?


Solution

  • (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:

    1. Clone the Clang repository

    2. 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.

    3. Another interesting file is /include/clang/Driver/Options.td, which includes the texts you get using the help command, if I recall correctly.