title: warning: variable set but not used [-Wunused-but-set-variable]
body: <p>I have been getting following warning while compiling the C source code in the <code>gcc 4.6.1</code>.</p>
  
  <pre><code>   warning: variable set but not used [-Wunused-but-set-variable]
  </code></pre>
  
  <p>I refered to this link <a href="https://stackoverflow.com/questions/6583237/wunused-but-set-variable-warning-treatment">Wunused</a> but could get exactly what is causing this warning.Would anybody tell me in more details what is causing this warning and how can We get rid of it?</p>
  
  <p>[EDIT]
   I have a following snippet of code. The compile shows the above mentioned warning. Could you please suggest me how can correct it?</p>
  
  <pre><code>   test_function(){
     BOOL BoolTest;
     BoolTest = test_fucntion2();
  
     #ifdef CHECK
     if (!BoolTest) {
     misc_StartErrorReport();
     misc_ErrorReport("\n test_function2: Input not indexed.\n");
     misc_FinishErrorReport();
            }
     #endif
     // 
      BoolTest is no more used below it.
     // } 
  </code></pre>