This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 18 Oct 2014 02:04:00 +0200
- Subject: Re: [PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQBi5c6KCnyB3iR7OR_xHxsoe0tie2d-bP3xjuX6y273dg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410172043260 dot 14369 at digraph dot polyomino dot org dot uk> <CAESRpQBnK_h44iJZMvgs4WCRfM66e-b=9x9V1sjvCofwz3i2Yw at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410172338200 dot 14369 at digraph dot polyomino dot org dot uk>
On 18 October 2014 01:43, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Sat, 18 Oct 2014, Manuel López-Ibáñez wrote:
>
>> 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)
>
> None of those three descriptions seems helpful here.
>
> The point of -pedantic is to give a diagnostic whenever the standard
> requires one (and possibly in some other cases). The point of
> -Werror=pedantic is to give an error for diagnostics enabled by -pedantic
> (whether or not the standard requires a diagnostic in those cases, and
> whether or not the standard requires successful translation in those
> cases). The point of -pedantic-errors is to give an error whenever the
> standard requires a diagnostic (and possibly in some other cases, but not
> cases where the standard requires successful translation).
Can we make "possibly in some other cases" more concrete? Otherwise,
the following seems already an improvement to me:
@@ -3318,8 +3327,10 @@
@item -pedantic-errors
@opindex pedantic-errors
-Like @option{-Wpedantic}, except that errors are produced rather than
-warnings.
+Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
+requires a diagnostic. This is not equivalent to
+@option{-Werror=pedantic}, since there are errors enabled by this option
+and not enabled by the latter and vice versa.
@item -Wall
@opindex Wall
Cheers,
Manuel.