title: What is the scope of a c++ macro redefinition?
body: <p>I have a c++ implementation file (my.cpp) that indirectly includes a header file (b.h) that defines _MAX_DRIVE:</p>
  
  <pre><code>// b.h
  #define _MAX_DRIVE  64
  </code></pre>
  
  <p>Then my.cpp includes stdlib.h which also defines _MAX_DRIVE</p>
  
  <pre><code>// stdlib.h
  #define _MAX_DRIVE  3   /* max. length of drive component */
  </code></pre>
  
  <p>Obviously this produces a macro-redefinition warning:</p>
  
  <pre><code>stdlib.h(185) : warning C4005: '_MAX_DRIVE' : macro redefinition
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How much code is affected by this redefinition, is it just the compilation unit for my.cpp? </li>
  <li>Could the redefined value make its way in to other code if my.cpp is part of a static library?</li>
  <li>If I never even reference _MAX_DRIVE in my.cpp, is is safe to tell the compiler to ignore this macro redefinition warning?</li>
  </ol>