http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60114
--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Manuel López-Ibáñez from comment #4) > (In reply to Chengnian Sun from comment #2) > > It seems -pedantic and -Woverflow are different. When I issue > > $ gcc-trunk -c -Woverflow s.c > > then there is no overflow warning. (There is indeed no overflow.) > > > > But when I use > > $ gcc-trunk -c -pedantic s.c > > the warning says that it is emitted from -Woverflow. Is this expected? > > There are some warnings that are only enabled if -Wpedantic is given in > combination with other flag. Unfortunately, there is currently no way to say > that a warning is enabled by the combination of two flags, short of creating > a new flag -Wpedantic-overflow, which is enabled by the combination of > -Wpedantic && -Woverflow. I think it could be a nice workaround That said, I think it would be even nicer to print the flags that appear in the command-line (or pragmas) that triggered this warning, instead of the flag that controls it. So here it will print [-Wpedantic,-Woverflow]. Although we now record the relations between the flags explicitly in the *.opt files, there is no explicit structure that allows following the chain of dependencies.