public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>,
	Gerald Pfeifer	<gerald@pfeifer.com>
Subject: Re: [PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic
Date: Fri, 17 Oct 2014 20:53:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1410172043260.14369@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CAESRpQBi5c6KCnyB3iR7OR_xHxsoe0tie2d-bP3xjuX6y273dg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1617 bytes --]

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 
executed).

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2014-10-17 20:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 18:40 Manuel López-Ibáñez
2014-10-17 20:53 ` Joseph S. Myers [this message]
2014-10-17 23:43   ` Manuel López-Ibáñez
2014-10-18  0:04     ` Joseph S. Myers
2014-10-18  0:14       ` Manuel López-Ibáñez
2014-10-18  0:41         ` Joseph S. Myers
2014-10-18 17:03           ` Manuel López-Ibáñez
2014-10-19 16:14             ` Joseph S. Myers
2014-10-21 18:26               ` Manuel López-Ibáñez
2014-10-21 22:01                 ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1410172043260.14369@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=lopezibanez@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).