title: What's the use of do while(0) when we define a macro?
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/154136/do-while-and-if-else-statements-in-c-c-macros">Do-While and if-else statements in C/C++ macros</a><br>
    <a href="https://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for">do { … } while (0) — what is it good for?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm reading the linux kernel and I found many macros like this:</p>
  
  <pre><code>#define INIT_LIST_HEAD(ptr) do { \
      (ptr)-&gt;next = (ptr); (ptr)-&gt;prev = (ptr); \
  } while (0)
  </code></pre>
  
  <p>Why do they use this rather than define it simply in a {}?</p>