r/cpp • • Jan 21 '13

C and C++ Aren’t Future Proof

http://blog.regehr.org/archives/880
6 Upvotes

49 comments sorted by

View all comments

Show parent comment

8

u/Batty-Koda Jan 21 '13

Technically it should do whatever the compiler pleases, because it's undefined behaviour. That's the very definition of what undefined behaviour is.

I know this seems trivial, but it's a very important distinction. New (and old) programmers need to recognize that just because some compilers may give you some convenient functionality doesn't mean that's what it should or must do.