5 ms·
Of course same is true for modern cpp.
by dingo_bat 8y ago
Of course same is true for modern cpp.
- Jweb_Guru 8y agoModern C++ does not mandate that every value be a valid instance of its type wherever it is theoretically accessible, so I'm not sure why you're saying modern C++ fixes this. Actually, the fact that Rust does is something people somewhat regularly complain about. It is a heavy-handed performance / code complexity vs. safety tradeoff that certainly fixes this bug, which I think is a pretty reasonable thing to point out.
- dingo_bat 8y agoIf you follow C++14 core guidelines, the defect described would not have occurred. The bug at its core is usage of unsanitized input data. You don't need to "mandate that every value be a valid instance of its type wherever it is theoretically accessible", however that may differ from simple sane C++14 paradigms. OPINION ALERT: Honestly guys get over rust, it does not offer a single advantage in real-life programming scenarios.
- sidlls 8y agoI disagree with people who think Rust is a savior, but it does have plenty of advantages in some areas over C and C++, especially for novices.
- deleted 8y ago[deleted]
- icebraining 8y agoSo I have to read a 21762 line document just to avoid shooting myself on the foot? There's a Rust advantage right there.
- dingo_bat 8y agoWho said anything about reading a document?
- icebraining 8y agoThe guidelines seem like a document to me: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md https://github.com/isocpp/CppCoreGuidelines/blob/master/CppC...
- dingo_bat 8y agoYou don't have to read them. The compiler will enforce them.
- icebraining 8y agoOh, ok, I didn't know that, thanks. Enforcing guidelines seems a bit like a contradiction in terms :)
- deleted 8y ago[deleted]
- Jweb_Guru 8y agoThe C++ compiler can't enforce many of these rules (and many of the ones it does claim to enforce, it only does heuristically), and the document itself is not shy about admitting that. It also makes quite clear that it expects not just mechanical checking, but things like peer review, to take these guidelines into account--meaning yes, you are expected to know a large portion of the document. Also, a lot of the listed enforcement mechanisms are literally just flagging suspicious code--you would have to disable a tremendous number of such flags to execute many perfectly reasonable programs. Stop misleading people about the contents of this document actually being enforced by the compiler, please.
- WalterBright 8y agoD also addresses buffer overflows in a mechanically checkable manner.