title: What does i = (i, ++i, 1) + 1; do?
body: <p>After reading <a href="https://stackoverflow.com/a/4176333/2411320">this answer</a> about undefined behavior and sequence points, I wrote a small program:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
    int i = 5;
    i = (i, ++i, 1) + 1;
    printf(&quot;%d\n&quot;, i);
    return 0;
  }
  </code></pre>
  <p>The output is <code>2</code>. Oh God, I didn't see the decrement coming! What is happening here?</p>
  <p>Also, while compiling the above code, I got a warning saying:</p>
  <blockquote>
  <p>px.c:5:8: warning: left-hand operand of comma expression has no effect<br></p>
  <pre><code>  [-Wunused-value]   i = (i, ++i, 1) + 1;
                          ^
  </code></pre>
  </blockquote>
  <p>Why? But probably it will be automatically answered by the answer of my first question.</p>