User documentation for supported warnings and --analyze mode

We are incorporating Clang in C lectures on Faculty of Informatics at
Masaryk University as an alternative to GCC.

Is there any user documentation on the supported warnings and type of
checks provided by --analyze? Specifically in relation to warnings
supported by GCC.

If you are comparing between GCC and Clang, are you more interested in static analyzer warnings, or compiler warnings? The latter is a better apples-to-apples comparison of functionality between the two compilers.

The '--analyze' option is simply a driver hook for activating the static analyzer, which really should be considered an entirely different tool than the compiler itself.

As for documentation on either compiler warnings or static analyzer warnings, that area is severely lacking. I'm working on documentation on the latter, and I think the goal is to eventually auto-generate the documentation for the compiler warnings, but that work isn't off the ground yet.

If you are comparing between GCC and Clang, are you more interested in static analyzer warnings, or compiler warnings? The latter is a better apples-to-apples comparison of functionality between the two compilers.

I want to compare supported warnings + get more information on the
static analyzer and its capabilities.

The '--analyze' option is simply a driver hook for activating the static analyzer, which really should be considered an entirely different tool than the compiler itself.

As for documentation on either compiler warnings or static analyzer warnings, that area is severely lacking. I'm working on documentation on the latter, and I think the goal is to eventually auto-generate the documentation for the compiler warnings, but that work isn't off the ground yet.

Basically I'm looking for something like this:
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Warning-Options.html#Warning-Options

Sounds completely reasonable. Unfortunately, documentation on either is completely lacking at this point. I think the goal is to eventually generate this documentation (semi-) automatically, but nobody has taken on that work yet.

If you are comparing between GCC and Clang, are you more interested

in static analyzer warnings, or compiler warnings? The latter is a
better apples-to-apples comparison of functionality between the two

compilers.

I want to compare supported warnings + get more information on the
static analyzer and its capabilities.

Sounds completely reasonable. Unfortunately, documentation on either is
completely lacking at this point.

That's a real shame because one of clang's greatest advantages over gcc
is it's warnings. I've often wondered if there's some great warning
flags that could help me that I haven't turned on because I just don't
know about them. :frowning:

Is there a -Wall-and-I-mean-really-all ? If so, combined with -
fdiagnostics-show-option, one could start with everything and weed out
ones considered too noisy.

Hi Sean,

All of the clang warning flags are maintained in ".td" files in clang/include/clang/Basic. Something that has been on my todo list for a very long time (but isn't likely to get tackled anytime soon) is to put descriptive text into the .td files for each flag... both a single line description suitable for -help output, and a full-on paragraph describing its use for the HTML manual and a man page.

The idea is that the clang binary (when passed --help, and some new flag) could then self describe the warning flags that it takes. I would actually really like to make the "clang --help" be a multilevel tool like the lldb console help system, so that you could have "clang --help warnings" for example to dive into various subsections of the help output, or "clang --help all" if you just want to grep through a giant dump of output.

If anyone is interested in this, it would make a very straight-forward "getting started with clang" project.

-Chris