Is this a gcc bug?

Bernd Schmidt bernds@redhat.com
Thu Jan 11 06:06:00 GMT 2001


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 (this is not all the difficult cases, but is a very
> high fraction of them). This would also catch macros where this happens
> less visibly.

Already there.  You just have to turn on warnings.


$ ./cc1 bug.i -Wall
 main
bug.i: In function `main':
bug.i:8: warning: implicit declaration of function `printf'

bug.i:8: warning: operation on `x' may be undefined

bug.i:8: warning: operation on `x' may be undefined

bug.i:8: warning: operation on `x' may be undefined


Bernd



More information about the Gcc mailing list