title: CppCheck. The scope of the variable can be reduced (and loop)
body: <p>CppCheck finds me some findings like: "The scope of the variable 'x' can be reduced".</p>
  
  <p>What if I have this situation:</p>
  
  <pre><code>int x;
  for (int i = 0; i != 10; ++i)
  {
      x = someFunction();
  
      // ... I use x variable here
  }
  </code></pre>
  
  <p>I think my code is OK. What do you think? Should it change to something like that?</p>
  
  <pre><code>for (int i = 0; i != 10; ++i)
  {
      int x = someFunction();
  
      // ... I use x variable here
  }
  </code></pre>
  
  <p>In the second code a variable x is defined for all iteration... Isn't not ok (not optimal), I guess..</p>