Skip to content

Why -Og over -O0 ? #187

@antoine-bussy

Description

@antoine-bussy

Hi 👋

When building with CMake in Debug mode, the qpp library sets the compiler optimization flag to -Og rather than -O0. For debugging, -O0 is generally preferred because it disables all optimizations and makes debugging more predictable. Using -Og can sometimes interfere with breakpoints and variable inspection in debuggers like GDB.

Moreover, this flag propagates to all consumer projects that link to qpp. As a result, the entire project (not just qpp) is built with -Og in Debug mode.

Is there a specific reason for choosing -Og over -O0 for Debug builds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions