Description
This issue suggests reviewing and potentially adopting parts of the OpenSSF best practices for Compiler Options Hardening Guide for C and C++.
The goal is to provide [.. compiler and linker options that contribute to delivering reliable and secure code using native (or cross) toolchains].
For example, the guide recommends the following flags for "production code" (I interpret it as relevant for release builds) are: -fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero.
These could help avoid issues like #2210 and other subtle bugs.
Description
This issue suggests reviewing and potentially adopting parts of the OpenSSF best practices for Compiler Options Hardening Guide for C and C++.
The goal is to provide [.. compiler and linker options that contribute to delivering reliable and secure code using native (or cross) toolchains].
For example, the guide recommends the following flags for "production code" (I interpret it as relevant for release builds) are:
-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero.These could help avoid issues like #2210 and other subtle bugs.