title: Why enclose blocks of C code in curly braces?
body: <p>I am looking at some C code, and have noticed it is full of these curly braces surrounding blocks of code without any sort of control structure. Take a look-see: </p>
  
  <pre><code>//do some stuff . . .
  fprintf(stderr, "%.2f sec\n", (float)(clock() - t) / CLOCKS_PER_SEC);
  {
      //a block! why not?
      char *tmp_argv[3];
      tmp_argv[0] = argv[0]; tmp_argv[1] = str; tmp_argv[2] = prefix;
      t = clock();
      fprintf(stderr, "[bwa_index] Convert nucleotide PAC to color PAC... ");
      bwa_pac2cspac(3, tmp_argv);
      fprintf(stderr, "%.2f sec\n", (float)(clock() - t) / CLOCKS_PER_SEC);
  }
  </code></pre>
  
  <p>Why would you insert blocks like this in the code? It is chock full of 'em. Is there some kind of performance benefit? Some mystical C thing? Why???</p>
  
  <p><strong>edit: </strong>This code if from <a href="http://bio-bwa.sourceforge.net" rel="noreferrer">BWA</a>, a bioinformatics program that aligns small sequences to large reference ones using the <a href="http://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform" rel="noreferrer">Burrows-Wheeler transform</a>, in case any of you were wondering. This code example isn't particularly relevant to the functionality of the application.</p>