4 ms·
At least with the C standard, it's theoretically possible to learn it. I'd challenge you to find one person in your company who fully understands the C++ standa
by Filligree 11y ago
At least with the C standard, it's theoretically possible to learn it. I'd challenge you to find one person in your company who fully understands the C++ standard.
- pjmlp 11y agoAnd I challenge you to find someone that knows all C rules about UB across all major compilers.
- hellofunk 11y agoTrue dat. C is a smaller language and is possible to know the whole language, but not the whole spectrum of UB. C++ is a vastly larger language it is nearly impossible to know the whole language, but much more likely to understand the spectrum of UB.
- octo_t 11y agoUndefined behaviour is the same across all compilers. The compilers aren't the things which make the behaviour undefined, its the C standard.
- pjmlp 11y agoNo it is not, if you ever tried to write portable C code you should clearly be aware that each C compiler has its own flavor of undefined behavior. The C standard is very generous in terms of undefined behavior freedom.
- dsfuoi 11y agoBy definition made in the C Standard, undefined behavior is: behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements If you're using some other definition, then say so, otherwise your comments make no sense.
- pjmlp 11y agoGiven my-app.c, each C compiler out there will pick a different UB subset and not everything that is defined as UB in the standard. They are free to do that and still be compliant, after all UB means anything goes.
- lorenzhs 11y agoThat compilers may behave differently is exactly the point of UB, if they all had to behave the same it wouldn't be undefined, after all!
- octoploid 11y agoWell, just use -fsanitize=undefined and it will point out (most of) the isuses for you.
- Ace17 11y agoProvided that your test suite properly trigger the execution of tricky parts, in tricky situations (You do have a test suite, right?)
- Kristine1975 11y ago>You do have a test suite, right? Of course I do. I call it "customers".
- pjmlp 11y agoWell, not all C compilers have it.
- easytiger 11y agoStroustroup in his book claims he doesn't fully understand it.
- rleigh 11y agoWell, this is the language where Turing-complete template metaprogramming was "discovered" as an emergent property of the system!
- CyberDildonics 11y agoGiant, complicated, wildly successful.