This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Tentative patch to catch a[n]=b[n++]...


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]