title: Why does g++ warning about uninitialized variable depend on the type of the variable? (it warns for an int but not for a double)
body: <p>I'm currently trying to understand in which cases g++ warns about uninitialized variables. Consider the following piece of code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  typedef double barType;
  
  struct foo {
  
      barType bar;
  
  };
  
  int main() {
  
      foo f;
  
      std::cout &lt;&lt; f.bar &lt;&lt; std::endl;
  
  }
  </code></pre>
  
  <p>If I compile it like this I get no warning:</p>
  
  <pre><code>$ g++ -O1 -Wall test.cc -o test
  </code></pre>
  
  <p>but if I change barType to int:</p>
  
  <pre><code>$ g++ -O1 -Wall test.cc -o test
    test.cc: In function ‘int main()’:
    test.cc:17: warning: ‘f.foo::bar’ is used uninitialized in this function
  </code></pre>
  
  <p>How can the warning depend on the type? It is uninitialized in both cases.</p>
  
  <p>I'm using:</p>
  
  <pre><code>$ g++ --version
  g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1
  Copyright (C) 2009 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Somebody</p>