title: Dr Memory and the mysterious uninitialized read
body: <p>The code below doesn't do anything interesting, but the mystery is why would Dr Memory think there's an unitialized read? Any ideas?</p>
  
  <pre><code>#include &lt;memory&gt;
  
  int main(int argc, const char* argv[])
  {
      int aa[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  
      std::unique_ptr&lt;int[]&gt; p {new int[10]};
  
      for (auto i = 0; i &lt; 10; ++i) {
          p[i] = aa[i];
      }
  
      return 0;
  } // &lt;-- Dr Memory says UNINITIALIZED READ here
  </code></pre>
  
  <p>EDIT: Here's the full error details.</p>
  
  <pre><code>Error #1: UNINITIALIZED READ: reading 0x0028ff20-0x0028ff24 4 byte(s)
  # 0 __mingw_glob                              [src/main.cpp:14]
  # 1 _setargv                                  [src/main.cpp:14]
  # 2 __mingw_CRTStartup
  # 3 mainCRTStartup
  # 4 ntdll.dll!RtlInitializeExceptionChain    +0x62     (0x772c8fe2 &lt;ntdll.dll+0x38fe2&gt;)
  # 5 ntdll.dll!RtlInitializeExceptionChain    +0x35     (0x772c8fb5 &lt;ntdll.dll+0x38fb5&gt;)
  Note: @0:00:00.297 in thread 9780
  Note: instruction: cmp    (%esi) $0x0040a11e
  </code></pre>