3 ms·
C++ up to and including '98 spec was terrible from security perspective, not a iota better than plain C.
by varjag 5y ago
C++ up to and including '98 spec was terrible from security perspective, not a iota better than plain C.
- pjmlp 5y agoOn the contrary, - proper string and vector types (most compilers allow to enable bounds checking anyway) - stronger rules for type conversions - reference types for parameters - better tooling for immutable data structures - memory allocation primitives instead of getting sizeof wrong to malloc() - collection library instead of reinventing the wheel in each project - RAII - smart pointers - templates instead of error prone macros - namespacing (usefull in large scale projects with prefix tricks)
- marrs 5y agoI'm more interested in the the actual statistics for security vulnerabilities found in C vs. C++ programmes, rather than theoretical benefits one language might have over the other.
- pjmlp 5y agoAny C++ vulnerabiliy caused by copy-paste compatibility with C is by definition a C vulnerabiliy.
- smhenderson 5y agoAll of which were heavy enough at the time to slow programs down enough that people chose to not use them in favor of faster, more portable C.