Add guideline to not invoke undefined behavior
At my CppCon 2022 talk Purging Undefined Behavior & Intel Assumptions in a Legacy C++ Codebase I spoke about a guideline we added to our fork of the Core Guidelines to not invoke undefined behavior. I got a question after the talk: "why is this not part of the core guidelines?"
Now that I am giving a new version of this talk at Meeting C++ I was inspired by this question to propose this as an upstream guideline.
The current wording is our internal wording that might need some upgrades but first I wanted to know if there was interest in accepting this guideline before doing further refinement of the text.
My initial reaction was that surely this goes without saying, does it really need to be a guideline? But after reading it, I think it does add value. It might be better to add some examples of the kind of thing that some developers might do, thinking it's ok to get away with it. For example, aliasing violations or signed integer overflow.
The text is written in the first person but the rest of the guidelines use second person.
For example, aliasing violations or signed integer overflow.
apropos the infamous felix-gcc bug report https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475
Editors call: We think this is a promising guideline, and please iterate with @GabrielDosReis and @jwakely to make it less wordy and add some examples.