Re: pre, post increment standard behaviour, and friend function declaration

From: Ron Natalie (ron_at_sensor.com)
Date: 01/27/04


Date: Tue, 27 Jan 2004 05:46:15 -0500


"Jack Klein" <jackklein@spamcop.net> wrote in message news:1mqb10h6nr0frbs3rm36tc387i8b86gbe5@4ax.com...
> No, honestly, it is unspecified as to whether it is undefined or not.
> There is nothing in the standard that prevents an implementation from
> evaluating all terms involving "k" before calling any of the operator
> functions. If an implementation does so, "k" is modified twice
> between sequence points, and its value is also accessed two other
> times in a manner not involved with calculating the new value. In
> this case, then, the behavior is undefined.

Nope, the behavior is simply undefined. The rules say that if the value is
modified twice between sequence point for ANY ALLOWABLE ORDERING
of operations, then the behavior is undefined.



Relevant Pages

  • Re: Sequence point problem?
    ... > Can anybody identify any sequence point problems in the expression below? ... The Standard says that between sequence points (and there are none in ... modified twice, once by ++ and the other time with the assignment, which ... If you rewrite this as ...
    (comp.lang.cpp)
  • Re: string upper, string lower, string subthisforthat
    ... | This requirement appears in the public draft standard (which is what ... as 'transform' can be used to modify a sequence in place ... | (i.e. one of the input iterators can be the same as the output ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Goodsteins Theorem
    ... all ordinals below epsilon_0. ... given Goodstein sequence is bounded in Peano Arithmetic, ... interpretation of Goodstein's Theorem as a number-theoretic assertion ... as standard PA, ought not to be accepted as definitive. ...
    (sci.logic)
  • Re: Goodsteins Theorem
    ... PA^- plus Sigma_1 induction) to arithmetical transfinite induction on ... all ordinals below epsilon_0. ... given Goodstein sequence is bounded in Peano Arithmetic, ... as standard PA, ought not to be accepted as definitive. ...
    (sci.logic)
  • Re: x=(x=5,11)
    ... But the standard is not ambiguous at all. ... There is a sequence point ... This was a red herring when it first entered the conversation and is ... sequence points is to insure that the evaluation is complete. ...
    (comp.lang.c)