That's a reasonable question. It's a shame this comment gets downvoted instead of the various people falling all over themselves to show off how smart they are by posting incorrect guesses about how undefined behavior doesn't matter.
Here's a good article that addresses the question "Why have undefined behavior?"
Here's a good article that addresses the question "Why have undefined behavior?"
http://blog.regehr.org/archives/213
This one linking to the above is also worth reading:
http://blog.llvm.org/2011/05/what-every-c-programmer-should-...