Declare and use variable in same statement
<p>In C is it valid to use a variable in the same statement in which it is declared? </p>

<p>In both gcc 4.9 and clang 3.5 the following program compiles and runs without error:</p>

<pre><code>#include "stdio.h"

int main() {
  int x = x;
  printf("%d\n", x);
}
</code></pre>

<p>In gcc it outputs <code>0</code> and in clang <code>32767</code> (which is largest positive 2-byte integer value).</p>

<p>Why does this not cause a compilation error? Is this valid in any particular C specification? Is its behavior explicitly undefined?</p>