title: w8004 compiler warning BDS6 c/c++
body: <p>It is a best practise to initialise a variable at the time of declaration.</p>
  
  <pre><code>int TMyClass::GetValue()
  {
      int vStatus = OK;
      // A function returns a value
      vStatus = DoSomeThingAndReturnErrorCode();
      if(!vStatus)
          //Do something
      else
         return(vStatus);
  }
  </code></pre>
  
  <p>In the debug mode, a statement like this  <code>int vStatus = OK;</code> is causing no issues during DEBUG MODE build.</p>
  
  <p>The same when build in RELEASE MODE, throws a warning saying:</p>
  
  <blockquote>
    <p>w8004: 'vStatus' is assigned a value that is never used.</p>
  </blockquote>
  
  <p>Also, i am using the same variable further down my code with in the same function,like this      <code>if(!vStatus)</code>and also I return the value of <code>return(vStatus);</code></p>
  
  <p>When I looked at the web for <a href="http://www.flounder.com/debug_release.htm" rel="nofollow noreferrer">pointers on this debug Vs Release</a>, compilers expect you to initialise your variable at the time of declaring it.</p>
  
  <p>I am using Borland developer studio 6 with windows 2003 server.</p>
  
  <p>Any pointers will help me to understand this issue.</p>
  
  <p>Thanks</p>
  
  <p>Raj</p>