News for hackers. Stuff that matters.
Re:So you think you know C? by loup-vaillant on Tuesday November 08, 2016 @07:00PM (#12905093)
The order of evaluation in such an expression is entirely unspecified. There are points in C programs that separate a "before" and an "after". The semicolon is a typical such point. There are others. Now between two adjacent points anything goes.

In this particular example the evaluations and effects are allowed to be interleaved:

    pre    = I + 1;      // evaluating the pre-increment
    post   = I;          // evaluating the post-increment
    I++;                 // effect of pre-increment
    I++;                 // effect of post-increment
    return pre + post;   // evaluating the sum
Simply put, pre and post-increment are allowed to occur "simultaneously".
Re:So you think you know C? by thick18cm on Wednesday November 09, 2016 @03:09AM (#12907552)
what you are saying may be correct, but you are "overloading" the term "order of evaluation" to encompass atomicity (atomicity of operations like i++); is that kosher?
Re:So you think you know C? by loup-vaillant on Thursday November 10, 2016 @05:37PM (#12925196)
Indeed I am. What I want to convey is, between 2 sequence points, C is actually non-strict. Any effect is like unsafeInterleaveIO from Haskell. Which is why I rarely mix up effects together or with a computation in a single instruction.