Re: Potentially false-positive -Wstringop-overflow= warning with gcc >= 11.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux