Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion THE POSTINCREMENT TIME
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Potter  
View profile  
 More options Apr 24 2003, 8:10 pm
Newsgroups: comp.lang.c++.moderated
From: John Potter <jpot...@falcon.lhup.edu>
Date: 24 Apr 2003 20:12:55 -0400
Local: Thurs, Apr 24 2003 8:12 pm
Subject: Re: THE POSTINCREMENT TIME
On 24 Apr 2003 19:15:27 -0400, ka...@gabi-soft.de (James Kanze) wrote:

> Any reordering which respects the above constraints is a legal execution
> path for the abstract machine.  If any legal execution path results in
> undefined behavior, the behavior is undefined.  Accessing a variable
> that is modified without an intervening sequence point (e.g. a function
> call) other than to determine the new value (which of course, introduces
> implicit ordering due to causal necessity) is undefined behavior.

You need to read a bit more carefully.  It is only accessing the old value
the gives undefined behavior.  Otherwise, j + ++ i would be undefined.

> In this case, one possible ordering is:

>     read c for incr
>     incr
>     store results of incr
>     read c for c

Put that last read at the top which is also allowed and you have undefined
behavior.

John

      [ Send an empty e-mail to c++-h...@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.