I'm using stl containers in my project and I discovered a weird error that I can't explain. Let's consider the following code:
#include <iostream>
#include <vector>
int main(int argc, char** argv)
{
std::vector<bool> vec;
vec.resize(5, false);
std::cout << vec.at(0);
}
This outputs 0 as expected, but if I run a memory check with drmemory it discovers an uninitialized read. Can anybody help in understanding this behaviour?
Platform: win32 ; Compiler: mingw32 - gcc 4.7.2 ; Drmemory 1.6.0 - build 2