Re:GNU Coding Standards: Writing Robust Programs
by varjag on Friday June 11, 2021 @08:20AM
(#27472301)
C++ up to and including '98 spec was terrible from security perspective, not a iota better than plain C.
[ Parent
| on HN ]
Re:GNU Coding Standards: Writing Robust Programs
by pjmlp on Friday June 11, 2021 @10:18AM
(#27473686)
On 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)
Re:GNU Coding Standards: Writing Robust Programs
by marrs on Friday June 11, 2021 @10:28AM
(#27473840)
I'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.
Re:GNU Coding Standards: Writing Robust Programs
by pjmlp on Friday June 11, 2021 @10:39AM
(#27474002)
Any C++ vulnerabiliy caused by copy-paste compatibility with C is by definition a C vulnerabiliy.
Re:GNU Coding Standards: Writing Robust Programs
by smhenderson on Friday June 11, 2021 @10:33AM
(#27473906)
All 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.