Re: gcc-14-1-0: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]

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

 



On Thu, Jul 18, 2024 at 12:33:36PM +0200, Josef Wolf wrote:
> On Thu, Jul 18, 2024 at 05:07:52AM -0500, Segher Boessenkool wrote:
> > Maybe -Wstringop-overflow should not be default (as it is now)?  Or
> > maybe just -Wstringop-overflow=2 should not be.  There are way too many
> > obvious (and confusing!) problems with it.
> 
> What good would be a broken warning if it is not active by default?

Heh :-)

> Even worse are the non-obvious problems. For an obvious problem, you can see
> very quickly that the warning doesn't make sense. For non-obvious cases, you
> would need to dive deeply into the problem before you (eventually) find that
> the warning does not make any sense.

The worst is that the warning message says a very definite "this or
that is wrong", while that is obviously not true.  Warning messages
should never lie.  Many (most?) warnings are heuristical (otherwise they
can typically be errors, instead: it usually is not "this is wrong", but
just "this looks wrong").  But the diagnostic we output should include
that fact!  It should never says "this *is* wrong" if we do not know for
sure.  Doing that is a disservice to our users.


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