title: Assignment and pointers, undefined behavior?
body: <pre><code>int func(int **a)
  {
      *a = NULL;
      return 1234;
  }
  
  int main()
  {
      int x = 0, *ptr = &amp;x;
      *ptr = func(&amp;ptr);      // &lt;-???
      printf("%d\n", x);      // print '1234'
      printf("%p\n", ptr);    // print 'nil'
  
      return 0;
  }
  </code></pre>
  
  <p>Is this an example of undefined behavior or has to do with sequence points?
  why the line:</p>
  
  <pre><code>*ptr = func(&amp;ptr);
  </code></pre>
  
  <p>doesn't behave like:</p>
  
  <pre><code>*NULL = 1234;
  </code></pre>
  
  <p>EDIT: I forgot to mention that I get the output '1234' and 'nil' with gcc 4.7.</p>