[cfe-dev] Warnings difference between gcc and clang

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 9 15:28:33 PDT 2015


On Fri, Oct 9, 2015 at 3:19 PM, Edward Diener via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> According to the gcc documentation if -Wall is used on the command line it
> can be overriddent by individual -Wno-xxx warnings which turn off
> individual warnings. But in clang if -Wall is used on the command line
> individual -Wno-xxx warnings are ignored.
>

That's not true. For clang, warning flags are processed left-to-right, so
-Wno-xxx flags appearing after -Wall turn off individual flags. (The way
clang's warning groups work in general is as if -Wgroup expands to
individual -W flags for each warning in the group; -Wall is just a normal
warning group containing a certain set of warnings.)

Does GCC really allow -Wno-xxx flags that /precede/ -Wall on the command
line to override -Wall? That seems broken.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151009/592a1ff1/attachment.html>


More information about the cfe-dev mailing list