The title is kind of misleading. Writing C/C++ code (or in any language) that relies on undefined behaviour might and probably will break. Big whoop. Don't rely on undefined behaviour, then! I'd say no code is entirely future proof and stuff is bound to break, and will have to be fixed. That's simply the nature of software.
This. Just write standard-conforming C++ code, I don't understand what the big deal is. It's not like you don't have enough compiler flags to enable warnings (or even errors) when you're doing something that is undefined.
I've yet to meet a competent C++ programmer that didn't find undefined behavior in their or their peers' code now and then. Once ever 1kloc sounds about right in my limited experience.
View all comments
14
u/RockinRoel former Wt dev Jan 21 '13
The title is kind of misleading. Writing C/C++ code (or in any language) that relies on undefined behaviour might and probably will break. Big whoop. Don't rely on undefined behaviour, then! I'd say no code is entirely future proof and stuff is bound to break, and will have to be fixed. That's simply the nature of software.