This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is this a gcc bug?
On Thu, 11 Jan 2001 dewar@gnat.com wrote:
> it seems like it would not be hard to implement a warning for the case where
> a variable is incremented or decremented somewhere in a statement, and
> referenced elsewhere
Bernd Schmidt <bernds@redhat.com> writes:
> Already there. You just have to turn on warnings.
>
> $ ./cc1 bug.i -Wall
> main
> bug.i: In function `main':
> bug.i:8: warning: operation on `x' may be undefined
I must say this is a very confusing error message, especally to
someone who does is not aware of the problem. I'm not sure I could
even begin to guess what it meant!
How about something like:
warning: 'x' may have unexpected value because of side-effects
or
warning: side-effects make value of 'x' undefined
or
warning: undefined order of side-effects on 'x'
One might replace "side-effects" by "updates" or "changes to".
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/