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 18:39:15 +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> <CAESRpQD8UVUn8YUN3+nwihm3LTM1G1OFVY4uyW0iwzLc19vs4g at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1410180011320 dot 14369 at digraph dot polyomino dot org dot uk>
On 18 October 2014 02:13, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Sat, 18 Oct 2014, Manuel López-Ibáñez wrote:
>
>> Can we make "possibly in some other cases" more concrete? Otherwise,
>
> Cases where something about the code is not defined by the base standard,
> but a diagnostic is not required. -pedantic may give a warning for such
> cases. -pedantic-errors may give an error *if* there is compile-time
> undefined behavior (not if the not-definedness is something other than
> undefined behavior, or is undefined behavior only if the code in question
> is executed, although it will still give a warning for such cases if
> -pedantic does).
What about this version?
Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
requires a diagnostic, in cases where there is undefined behavior at
compile-time
and in some other cases that do not prevent compilation of programs
that are valid according to the standard.
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.
Cheers,
Manuel.