Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Full Clang warning list with descriptions

Tags:

warnings

clang

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?

like image 533
Andrew Avatar asked Aug 31 '15 08:08

Andrew


2 Answers

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.

like image 196
murfito Avatar answered Oct 12 '22 16:10

murfito


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.

like image 29
hagi Avatar answered Oct 12 '22 14:10

hagi