title: VS2013 ignoring pragma warning disable
body: <pre><code>int main() {
  #pragma warning(push)
  #pragma warning(disable: 4101)
      int i;
  #pragma warning(pop)
  }
  </code></pre>
  
  <p><strong>########################### OR ###########################</strong></p>
  
  <pre><code>int main() {
  #pragma warning(suppress: 4101)
      int i;
  }
  </code></pre>
  
  <p>I believe either of these should compile on Visual Studio 2013 with warnings treated as errors, with no C4101 warning (about I being an unreferenced local variable.)  It's a level 4 warning.</p>
  
  <p>But, it's still giving me the warning.  Even if I turn off warnings treated as errors, it still gives me the warning, although then it compiles because there's no error.</p>
  
  <p>I'm not using precompiled headers / stdafx.h.  I saw some other questions saying this pragma technique would work around actual code (perhaps they meant code in headers but didn't specify or look like that).  Some others vaguely saying without explanation any #pragma commands before stdafx.h would be ignored.  But '<a href="https://msdn.microsoft.com/en-us/library/d9x1s805(v=vs.120).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/d9x1s805(v=vs.120).aspx</a>' specifically mentions pragma can be in source code to override compiler options.  Granted, I've never used stdafx.h, being more a unix guy, so perhaps there's something totally fundamental I'm totally missing.</p>
  
  <p>I've tried specifying C4101 instead of just 4101, and it can't handle an alpha in there.  I've tried specifying #pragma warning(push 2) even though that would hit all level 3&amp;4 level warnings which I don't want to do - and even that still gives the level 4 warning.</p>
  
  <p>Here's my compiler command line options: <code>/MP /GS /W4 /Zc:wchar_t /Zi /Gm- /Od /sdl /Fd"&lt;...&gt;\pragmaWarning\Intermediate\vc120.pdb" /fp:precise /errorReport:prompt /WX- /Zc:forScope /RTC1 /Gd /MDd /Fa"&lt;...&gt;\pragmaWarning\Intermediate\" /EHsc /nologo /Fo"&lt;...&gt;\pragmaWarning\Intermediate\" /Fp"&lt;...&gt;\pragmaWarning\Intermediate\pragmaWarning.pch"</code></p>
  
  <p>As you may see, those command line options omit the warnings treated as errors.</p>