A huge number of operations in C++ result in undefined behavior, where the spec is completely mute about what the program\'s behavior ought to be and allows for anything to
Take a look at PCLint its pretty decent at detecting a lot of bad things in C++.
Here's a subset of what it catches