title: C multi-line macro: do/while(0) vs scope block
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/923822/whats-the-use-of-do-while0-when-we-define-a-macro">What&rsquo;s the use of do while(0) when we define a macro?</a><br>
    <a href="https://stackoverflow.com/questions/154136/why-are-there-sometimes-meaningless-do-while-and-if-else-statements-in-c-c-macr">Why are there sometimes meaningless 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 { &hellip; } while (0)  what is it good for?</a>  </p>
  </blockquote>
  
  <p>I've seen some multi-line C macros that are wrapped inside a do/while(0) loop like:</p>
  
  <pre>
  #define FOO \
    do { \
      do_stuff_here \
      do_more_stuff \
    } while (0)
  </pre>
  
  <p>What are the benefits (if any) of writing the code that way as opposed to using a basic block:</p>
  
  <pre>
  #define FOO \
    { \
      do_stuff_here \
      do_more_stuff \
    }
  </pre>