I've recently ported a Linux C++ application to Windows (via Visual Studio 2010 C++ express). In the process I've noticed the Windows executable tends to pick up on subtle bugs in my code, crashing the program. But the same code and bug seems to go unnoticed in Linux/GCC and the program will continue running happily. I've seen this behaviour in past programs I tried to port. An example bug in my code is writing pass an array by 1 element.
What flags can I enable to improve run-time error catching in GCC? I want my program to be as volatile as the Windows version when it encounters the slightest run-time bug. Or does this depend more on the OS and is out of the user's control?