Skip to content

Review and Apply Hardened Default Compiler Options #2282

@bhess

Description

@bhess

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Todo

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions