This is the mail archive of the gcc-patches@gcc.gnu.org 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 17 October 2014 22:46, Joseph S. Myers <joseph@codesourcery.com> wrote:
>> @@ -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
> executed).

The previous version also does not match your description. You are saying that

-Wpedantic = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic)
and -pedantic-errors = pedwarn(OPT_Wpedantic).+ pedwarn(0)

The current version says that

-Wpedantic = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic)
and -pedantic-errors = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic)

My proposal says that:

-Wpedantic = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic)
and -pedantic-errors = warning(OPT_Wpedantic) + pedwarn(OPT_Wpedantic)
+ pedwarn(0)

which perhaps is not how it should be, but it is strictly more correct
in the sense that it is wrong in exactly the same thing but it is
right in one more than the current version.

Cheers,

Manuel.


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