Why does the following code crashes at run-time in Visual Studio 2012?
void foo(void* ptr)
{
}
int main()
{
void* ptr;
foo(ptr);
}
Run-Time Check Failure #3 - The variable 'ptr' is being used without being initialized.
I know that this error can be disabled by setting the "Basic Runtime Checks" option to "Default" but I don't see any reason why I should have this error when I don't actually dereference the specified pointer.
Is it an intented behavior?