title: Are compound statements (blocks) surrounded by parens expressions in ANSI C?
body: <p>Browsing the Linux kernel sources I found <a href="http://lxr.linux.no/linux+v2.6.30/arch/x86/include/asm/uaccess.h#L332" rel="noreferrer">some piece of code</a> where a block of statements surrounded by parenthesis is treated as a expression <em>a la lisp</em> (or ML), that is, an expression which value is the value of the last statement.</p>
  
  <p>For example:</p>
  
  <pre><code>int a = ({
      int i;
      int t = 1;
      for (i = 2; i&lt;5; i++) {
          t*=i;
      }
      t;
  });
  </code></pre>
  
  <p>I've been looking at the <a href="http://www.lysator.liu.se/c/ANSI-C-grammar-y.html#assignment-expression" rel="noreferrer">ANSI C grammar</a> trying to figure out how this piece of code would fit in the parse tree, but I haven't been successful.</p>
  
  <p>So, does anybody know if this behaviour is mandated by the standard or is just a peculiarity of GCC?</p>
  
  <p><strong>Update:</strong> I've tried with the flag -pedantic and the compiler now gives me a warning:</p>
  
  <pre><code>warning: ISO C forbids braced-groups within expressions
  </code></pre>