This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Tentative patch to catch a[n]=b[n++]...
- To: Kaz Kylheku <kaz at cafe dot net>
- Subject: Re: Tentative patch to catch a[n]=b[n++]...
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sat, 28 Mar 1998 00:27:56 -0700
- cc: "'Jim Wilson'" <wilson at cygnus dot com>, Michael Meeks <michael at imaginator dot com>, "egcs at cygnus dot com" <egcs at cygnus dot com>
- Reply-To: law at cygnus dot com
In message <01BD58BB.84FD66D0.kaz@cafe.net>you write:
> On Wednesday, March 25, 1998 1:04 PM, Jim Wilson [SMTP:wilson@cygnus.com]
> wrote:
> > I have written a patch for gcc-2.8.1 / egcs-1.0.2 that flags
> > warnings on the more simple cases of modifying a variable between seque
> nce
> > points.
> >
> > It would be interesting to have such a warning option in gcc.
>
> Interesting, but probably not useful. Only boneheaded programmers write the
> simple cases; and the not-so-simple cases are difficult to detect.
> I would find it a waste of compile time for my own code, and annoying
> if it warns on correct code.
It doesn't have to be on by default. And I would find it useful.
It's not uncommon for me to take suspicious bug reports and run
them through a "warn about everything" compile to see if any source
issues need to be looked at *before* spending the time analyzing
the generated code to look for a potential bug.
It's worth noting that several warning options will give false
positive warnings. The question at had is how often do we get
false positives :-)
jeff