title: Forcing local variables to be default-initialized
body: <p>In C++, plain-old-data (POD) local variables are uninitialized by default. I've noticed, though, that this leads to bugs, since attempting to read the value of an uninitialized variable is undefined behavior.</p>
  
  <p>Is there a way to force the compiler to automatically initialize all local variables? Perhaps a compiler that has this feature built in, or a compiler switch for one of the common compilers, like GCC or Clang? I would be fine with a Gnu extension; it doesn't have to be standard.</p>
  
  <p>I would expect the variables to be default-initialized, meaning that an <code>int</code> would be set to 0.</p>
  
  <p>I am bored with assigning all local <code>int</code>s and private class fields to 0.</p>