title: When do we need #ifdef before #undef?
body: <p>In many of the C and C++ files I have seen macros like this:</p>
  
  <pre><code>#ifdef X
  #undef X  // no statements in between
  #endif
  </code></pre>
  
  <p>I feel that, it's adequate to simply write:</p>
  
  <pre><code>#undef X
  </code></pre>
  
  <p>If the macro <code>X</code> wasn't defined, then the <code>#undef</code> should have no effect.</p>
  
  <p>Is it <em>ok</em> to put standalone <code>#undef</code>, if I want to only <em>undefine</em> a macro ? Does that make the coding practice bad in anyway ?</p>