3 ms·
Do popular compilers ship with an option that forbids the use of all memory-unsafe constructs? If not, then "modern C++" is still not memory-safe.
by throw10920 4y ago
Do popular compilers ship with an option that forbids the use of all memory-unsafe constructs?
If not, then "modern C++" is still not memory-safe.
- pencilguin 4y agoWhere there is no need for any unsafe construct, code that therefore does not use them is safe. The same applies to, e.g., Rust: any Rust program may use unsafe blocks. That Rust programs may contain unsafe blocks does not make Rust implicitly unsafe. Even using unsafe blocks does not, by itself, make the program unsafe.
- throw10920 4y agoYour dodging of my question leads me to believe that the answer is "no". Therefore, "modern C++" is still unsafe. > Even using unsafe blocks does not, by itself, make the program unsafe. This is false. "Unsafe" means that there is the potential to cause memory safety bugs. Unsafe blocks and C++ cause this, by definition. "Unsafe" does not mean that a memory safety bug actually exists. Moreover, I didn't mention anything about Rust in my comment.