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]
Other format: [Raw text]

RE: warning: operation on 'zero' may be undefined


> -----Original Message-----
> From: gcc-owner On Behalf Of Paul Schlie
> Sent: 01 October 2004 18:43

> Yes, fully agree; and since the expression's value is 
> insensitive to the
> order of evaluation of it's sub-expression arguments, it's 
> unambiguous;
> just as i = ++i is unambiguous, as it's sub expression argument values
> are not interdependent.
> The lhs computes the an lvalue, which is independent of it's 
> referenced
> content rvalue; just as the lvalue of x is independent of the 
> rvalues of
> a, b, or c, which are in turn have values which are 
> independent of each
> other's evaluated rvalues.

  The two cases are not equivalent.  In both, you have TWO assignments, not one;
in the case of "i = ++i", it is mere good fortune that they are assigning the same
value to i, rather than two entirely different values, as is the case in "i =
(++i) % 3" for any value of i >= 3.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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