title: What is an automatic variable in this setjmp/longjmp context?
body: <p>Advanced Programming in the UNIX Environment by W. Richard Stevens states:</p>
  
  <blockquote>
    <p>"What are the the states of the automatic variables and register
    variables in the main function?"</p>
  </blockquote>
  
  <p>with regard to what happens when you <code>longjmp</code> back to main (or another function) from somewhere lower down the stack.</p>
  
  <p>It goes on to say:</p>
  
  <blockquote>
    <p>"It depends. Most implementations do not try to roll back these
    automatic variables and register variables, but all that the standards
    say is that their values are indeterminate.  If you have an automatic
    variable that you don't want rolled back, define it with the
    <code>volatile</code> attribute.  Variables that are declared global or static
    are left alone when <code>longjmp</code> is executed.</p>
  </blockquote>
  
  <p>It seems like he's saying that normal stack-variables will not have their values set back to what they were at the time of the setjmp - but then the rest of the function couldn't rely on its stack variables after the longjmp back to it which seems crazy, so I'm guessing I'm wrong.</p>
  
  <p>Can someone define "automatic variables" for me and explain what specifically isn't set back to its original value and why that is?</p>