[cfe-dev] Warnings difference between gcc and clang

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 9 16:21:28 PDT 2015


On Fri, Oct 09, 2015 at 07:09:22PM -0400, Edward Diener via cfe-dev wrote:
> >Does GCC really allow -Wno-xxx flags that /precede/ -Wall on the command
> >line to override -Wall? That seems broken.
> 
> Yes, but it is not broken. According to gcc's documentation that is the way
> it should be. The gcc compiler is not order sensitive in allowing a specific
> compiler warning to override a general compiler warning. Therefore a
> specific -Wno-xxx warning will override a -Wall or -Wextra warning no matter
> where on the command line a specific warning is in relation to the general
> warning.

Just because someone had the brilliant idea to implement it that way
doesn't mean others agree. Most important, the GCC behavior starts to
show its insanity as soon as you have multiple levels of warning groups.

Joerg



More information about the cfe-dev mailing list