From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Kaz Kylheku Cc: "'Jim Wilson'" , Michael Meeks , "egcs@cygnus.com" Subject: Re: Tentative patch to catch a[n]=b[n++]... Date: Sun, 29 Mar 1998 05:14:00 -0000 Message-id: <13170.891070076@hurl.cygnus.com> References: <01BD58BB.84FD66D0.kaz@cafe.net> X-SW-Source: 1998-03/msg00992.html 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