title: Why does XOR swap with integers trigger a warning?
body: <p>I typed the following program:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      int a = 3;
      int b = 42;
  
      printf("a = %d\nb = %d\n", a, b);
  
      printf("Exchanging values.\n");
      a ^= b ^= a ^= b;
  
      printf("a = %d\nb = %d\n", a, b);
  
      return 0;
  }
  </code></pre>
  
  <p>and it's ok. When I try to compile it, I get this:</p>
  
  <pre><code>$ gcc test.c -o test -Wall -Wextra -ansi -pedantic-errors
  test.c: In function ‘main’:
  test.c:11: warning: operation on ‘a’ may be undefined
  </code></pre>
  
  <p>That's pretty much standard code, isn't it?</p>
  
  <p>Why does it trigger a warning? As far as I know, bitwise XOR is implemented by default for <code>int</code> as long as you are using a standard implementation of C.</p>
  
  <p>Thank you very much.</p>