Jim Meyering <j...@meyering.net> writes: > Paul Eggert wrote: >> On 11/30/11 02:25, Jim Meyering wrote: >>> how about automating the extraction of the list of >>> warnings from gcc sources or from some web page >> >> Or perhaps extract it from the gcc executable >> itself? Then you'd get all the warnings that the >> current GCC supports. > > Hah! > > I didn't know about --help=warnings. > That looks perfect. > > For a quick and dirty comparison, I did this: > (using gcc 4.7.0 20111124) > > diff -u \ > <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' /gnulib/m4/manywarnings.m4 |sort) \ > <(gcc --help=warnings|sed -n 's/^ \(-[^ ]*\) .*/\1/p' |sort) > > which shows at least one false positive (i.e. -Wformat=2 vs -Wformat=) > and many new warnings:
Many of the new ones you list are for non-C. The -Wformat=2 should be correct, I believe the gcc --help=warnings output is incorrect? -Wformat is implied by -Wall but -Wformat=2 adds more. The --all-warnings and --extra-warnings are interesting, they were not present when manywarnings.m4 was created. I wonder how they work. /Simon