Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To disable warnings from system headers over which you have no control just use this construct:</p> <pre><code>#pragma warning(push, 0) //Some includes with unfixable warnings #pragma warning(pop) </code></pre> <p>or more selectively for specific warnings:</p> <pre><code>#pragma warning( push ) #pragma warning( disable : 4081) #pragma warning( disable : 4706 ) // system header includes #pragma warning( pop ) </code></pre> <p>This answer was purloined from another Stack Overflow thread: (<a href="https://stackoverflow.com/questions/2541984/how-to-suppress-warnings-in-external-headers-in-visual-c" title="Suppress Warnings in External Headers">https://stackoverflow.com/questions/2541984/how-to-suppress-warnings-in-external-headers-in-visual-c</a>).</p> <p>I fully agree with the comments made by "edA-qa mort-ora-y". I want to see all warnings in my code, including important stuff like C4265 (DTOR not virtual). Although C4265 is at warning level 3, Microsoft in their wisdom have switched it off by default and you need /Wall to get it. See this page for more information about which warnings are hidden:</p> <p><a href="http://msdn.microsoft.com/en-GB/library/23k5d385(v=vs.80).aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-GB/library/23k5d385(v=vs.80).aspx</a></p> <p>To see these and to suppress the noise from the external headers, this page gives great advice, and I think fully answers the original question which started this thread:</p> <p><a href="http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/b/vcblog/archive/2010/12/14/off-by-default-compiler-warnings-in-visual-c.aspx</a></p> <p>Basically it advises to create a 'global' include file with the appropriate #pragmas to suppress the warnings you don't care about (maybe C4820 the padding one), to guard against external headers in the manner described above, then the compile with /Wall. That's a piece of work, but worth it. Under GCC it would just be a question of using -isystem. Microsoft development: take note! VS is a smart product but it's really dumb sometimes with the simple stuff.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload