title: Can I suppress a specific C6031 warning? CString::LoadString
body: <p>I have read this <a href="https://msdn.microsoft.com/en-us/library/81s4zzd4.aspx" rel="nofollow noreferrer">link</a> so have a basic understanding of what the warning refers to.</p>
  
  <p>When I run code analysis on my MFC project I get a barrage of these warnings:</p>
  
  <pre><code>d:\my programs\2017\meetschedassist\meeting schedule assistant\synchexclusionsdlg.cpp(295): warning C6031: Return value ignored: 'ATL::CStringT&lt;wchar_t,StrTraitMFC&lt;wchar_t,ATL::ChTraitsCRT&lt;wchar_t&gt; &gt; &gt;::LoadStringW'.
  d:\my programs\2017\meetschedassist\meeting schedule assistant\synchexclusionsdlg.cpp(297): warning C6031: Return value ignored: 'ATL::CStringT&lt;wchar_t,StrTraitMFC&lt;wchar_t,ATL::ChTraitsCRT&lt;wchar_t&gt; &gt; &gt;::LoadStringW'.
  </code></pre>
  
  <p>So, for example, it complains about this code snippet:</p>
  
  <pre><code>if (iImage == IMG_CHECKED)
      strText.LoadString(IDS_STR_YES);
  else
      strText.LoadString(IDS_STR_NO);
  </code></pre>
  
  <p>I have read the help documentation for <a href="https://msdn.microsoft.com/en-us/library/a44fb3wy.aspx" rel="nofollow noreferrer">LoadString</a> and ironically their example does this:</p>
  
  <pre><code>CAtlString s;
  s.LoadString(IDS_APP_TITLE);   
  </code></pre>
  
  <p>They don't test the return value either. :)</p>
  
  <p>Now, I realise that I could try to fix my code and test the return values - which will take me a very long time! And I realise that I can just subconsciously ignore these warnings.</p>
  
  <p>But is it possible to supress this specific warning (concerning <strong>C6031</strong> <code>CString::LoadString</code>) during analysis?</p>
  
  <hr>
  
  <h2>Update</h2>
  
  <p>I have tried adding this to my <code>stdafx.h</code> (based on comments):</p>
  
  <pre><code>#pragma warning( disable : 6031)
  </code></pre>
  
  <p>It certainly works. But I was hoping to just supress 6031 errors for <code>CString::LoadString</code>.</p>