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: "'Jim Wilson'" <wilson at cygnus dot com>, Michael Meeks <michael at imaginator dot com>
- Subject: RE: Tentative patch to catch a[n]=b[n++]...
- From: Kaz Kylheku <kaz at cafe dot net>
- Date: Thu, 26 Mar 1998 13:31:43 -0800
- Cc: "egcs at cygnus dot com" <egcs at cygnus dot com>
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 sequence
> 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.
Perhaps a run-time diagnosis based on the bounds checking code would
be more fruitful, in that it would actually detect when a modification has
happened to the same object more than once in arbitrarily complex
cases.