Skip to content

The module cpu_usage2 doesn't compile with clang/llvm #504

Description

@COLAMAroro

Expected behavior

The module should build without any issue

Actual behavior

The module fails to build, with the following error message

cpu_usage2.c:127:25: error: invalid suffix 'D' on floating constant
    display(label, 100.0D * (used - old_used) / (total - old_total),

i3blocks config relevant to blocklet(s)

N/A

Output of blocklet(s) when run from command line

N/A

Output of any relevant other commands that might help diagnostics

This build error is causing build failures on upstream projects. See relevant Gentoo Bugzilla report:
https://832200.bugs.gentoo.org/attachment.cgi?id=763789

According to cppreference, D is not a valid suffix for a floating-point literal. Removing the suffix would make it a double by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions