public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: Martin Sebor <msebor@gmail.com>,
	Martin Sebor via Gcc-help <gcc-help@gcc.gnu.org>,
	Dumitru Ceara <dceara@redhat.com>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: Potentially false-positive -Wstringop-overflow= warning with gcc >= 11.1
Date: Wed, 2 Feb 2022 12:33:34 -0600	[thread overview]
Message-ID: <20220202183334.GA614@gate.crashing.org> (raw)
In-Reply-To: <CAH6eHdSVwQnkCav6ajRzs1bHEyLb7W8m_0BeySnVD9ZBaqUw_w@mail.gmail.com>

On Wed, Feb 02, 2022 at 10:12:44AM +0000, Jonathan Wakely wrote:
> On Tue, 1 Feb 2022 at 23:55, Martin Sebor via Gcc-help
> > There's plenty of literature out there that explains this, including
> > the GCC manual, so I'd expect most C/C++ programmers to understand
> > that.
> 
> I disagree. So does the manual:
> 
>       -Warray-bounds
>       -Warray-bounds=n
>           This option is only active when -ftree-vrp is active
> (default for -O2 and above). It
>           warns about subscripts to arrays that are always out of
> bounds. This warning is
>           enabled by -Wall.

Yes, that is wrong as written.  Please open a PR?

> If we're going to claim that it's common knowledge that warnings are
> always contextual and not definite, can we not use language like
> "always out of bounds"? How else am I supposed to read that other than
> "always"? Always, under specific conditions? That's not what the word
> means.

I agree.

It is essentially always possible to phrase an error to be friendlier as
well as much more correct at the same time, without being much more
verbose.  This takes effort, but it is an investment that pays off
greatly and immediately.


Segher

  reply	other threads:[~2022-02-02 18:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 15:01 Dumitru Ceara
2022-01-28 15:27 ` Segher Boessenkool
2022-01-28 16:16   ` Dumitru Ceara
2022-01-28 17:37     ` Segher Boessenkool
2022-01-31 21:49     ` Martin Sebor
2022-01-31 22:01       ` Segher Boessenkool
2022-02-01  8:21         ` Jonathan Wakely
2022-02-01  5:18       ` Richard Sandiford
2022-02-01 14:42         ` Segher Boessenkool
2022-02-01 23:54         ` Martin Sebor
2022-02-02 10:12           ` Jonathan Wakely
2022-02-02 18:33             ` Segher Boessenkool [this message]
2022-02-02 20:44               ` Jonathan Wakely
2022-02-02 18:23           ` Segher Boessenkool

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=20220202183334.GA614@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dceara@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=msebor@gmail.com \
    --cc=richard.sandiford@arm.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).