Safe C++

01 Mar 2025

[ c++  coding  development  ]

Introduction

Software of Unknown Provenance (SOUP)

Software Bill of materials (SBOM)

Cybersecurity Bill of Materials

Functional correctness

Functional safety

Security

Why C++

Compiler Hardening

Setup

-O2 -Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough
-Werror=format-security
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
-D_GLIBCXX_ASSERTIONS
-fstrict-flex-arrays=3
-fstack-clash-protection -fstack-protector-strong
-Wl,-z,nodlopen -Wl,-z,noexecstack
-Wl,z,relro -Wl,z,now
-Wl,-as-needed -Wl,--no-copy-dt-needed-entries

Important

Sanitizers

References