title: gcc - removing "is used uninitialized in this function" warning
body: <p>Cleaning code from warning after adding -O2 -Wall flags to gcc (4.4.6).
  I have a lot of warning in some legacy code. This is very simplified version to demonstrate the problem:</p>
  
  <pre><code> 1 #include &lt;cstdio&gt;
    2
    3 bool init(bool&amp; a)
    4 {
    5     return true;
    6 }
    7
    8 int main()
    9 {
   10     bool a;
   11
   12     if (!init(a))
   13     {
   14         return 1;
   15     }
   16
   17     if (a)
   18     {
   19         printf("ok\n");
   20     }
   21 }
  </code></pre>
  
  <p>When compiling it as "gcc main.cpp -O2 -Wall" I receive:</p>
  
  <pre><code> main.cpp:17: warning: `a' is used uninitialized in this function
  </code></pre>
  
  <p>In real code, init() returns true only if it initializes "a", so there's virually no use by uninitialized "a".</p>
  
  <p>Whan can be done to fix the warning.</p>