Sequence points

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Theese

    Sequence points


    Hello all,

    I have read the definition of a sequence point in the standard and can
    follow it mechanically, but for some reason, I'm having a hard time grasping
    the conceptual meaning and significance. Can someone out there offer good
    intuition on sequence points???

    Thank you!
    Dave


  • Alf P. Steinbach

    #2
    Re: Sequence points

    On Tue, 2 Sep 2003 19:19:55 -0700, "Dave Theese" <cheeser_1998@y ahoo.com> wrote:
    [color=blue]
    >I have read the definition of a sequence point in the standard and can
    >follow it mechanically, but for some reason, I'm having a hard time grasping
    >the conceptual meaning and significance. Can someone out there offer good
    >intuition on sequence points???[/color]

    Goodest intuition: you don't need to think about them if you avoid
    expressions with side-effects.

    That also generally gives much more clear code.

    Leave it to the compiler to do the trivial optimizations.

    Comment

    • Karl Heinz Buchegger

      #3
      Re: Sequence points



      Dave Theese wrote:[color=blue]
      >
      > Hello all,
      >
      > I have read the definition of a sequence point in the standard and can
      > follow it mechanically, but for some reason, I'm having a hard time grasping
      > the conceptual meaning and significance. Can someone out there offer good
      > intuition on sequence points???[/color]

      Sequence points are a somewhat artificial concept. Basically a sequencepoint
      is a spot in processing where you can be sure that every computation has finished
      and the results are where they should be. Between 2 sequencepoints the compiler
      is free to rearrange things any way it pleases him. So you cant relay on anything.
      Only after a sequencepoint is passed, it is safe to expect results where they
      should be.

      --
      Karl Heinz Buchegger
      kbuchegg@gascad .at

      Comment

      Working...