title: Does the C preprocessor strip comments or expand macros first?
body: <p>Consider this (horrible, terrible, no good, very bad) code structure:</p>
  
  <pre><code>#define foo(x) // commented out debugging code
  
  // Misformatted to not obscure the point
  if (a)
  foo(a);
  bar(a);
  </code></pre>
  
  <p>I've seen two compilers' preprocessors generate different results on this code:</p>
  
  <pre><code>if (a)
  bar(a);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>if (a)
  ;
  bar(a);
  </code></pre>
  
  <p>Obviously, this is a bad thing for a portable code base.</p>
  
  <p>My question: What is the preprocessor supposed to do with this? Elide comments first, or expand macros first?</p>