title: Is there a good reason to initialize a static variable on every call to the function where it is defined?
body: <p>A colleague is doing some code review, and he is seeing many static variable declarations similar to the following:</p>
  
  <pre><code>void someFunc(){
  
     static int foo;
     static int bar;
     static int baz;
  
     foo = 0;
     bar = 0;
     baz = 0;
  
     /* 
         rest of the function code goes here
     */
  
  }
  </code></pre>
  
  <p>Our question is,
  Are the programmers who wrote this code simply unclear on the concept of a static variable,
  or is there some clever reason to do this on purpose?</p>
  
  <p>If it makes any difference, the environment is an embedded microcontroller and the compiler is GCC.</p>