This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic

On Fri, 17 Oct 2014, Manuel López-Ibáñez wrote:

> +Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
> +options, such as @option{-Wunused}, which may turn on further options,
> +such as @option{-Wunused-value}. The combined effect of positive and
> +negative forms is that more specific options have priority over less
> +specific ones, independently of their position in the command-line. For
> +options of the same specificity, the last one takes effect. Options
> +enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
> +as if they appeared at the end of the command-line.

This part is OK.

> @@ -3318,8 +3327,8 @@
>  @item -pedantic-errors
>  @opindex pedantic-errors
> -Like @option{-Wpedantic}, except that errors are produced rather than
> -warnings.
> +This is equivalent to @option{-Werror=pedantic} plus making into errors
> +a few warnings that are not controlled by @option{-Wpedantic}.

But I think the previous version is better here.  Maybe at present your 
version is true, but in principle -Wpedantic can control warnings that 
aren't pedwarns.  Some of the -Wformat warnings are conditional on having 
both -Wformat and -Wpedantic enabled - we can only represent those using 
OPT_Wformat in the warning calls at present, but there's at least as case 
for -Werror=pedantic to turn them into errors (while -pedantic-errors 
definitely should not turn them into errors, as the code is only invalid 
at runtime and is valid at compile time as long as it never gets 

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]