Skip to content

Add warn_unused_result to functions that return bool in memory.h #311

@agnosticlines

Description

@agnosticlines

Building off of #310

Recent fixes (bd3914e, 173a069) addressed unchecked return values from memory_map_fixed and memory_purge. Adding __attribute__((warn_unused_result)) to the functions that return bool in memory.h would catch this class at compile time with -Werror.

Candidates: memory_map_fixed, memory_map_fixed_mte, memory_unmap, memory_protect_ro, memory_protect_rw, memory_protect_rw_metadata, memory_remap, memory_remap_fixed, memory_purge.

You could also add it to memory_set_name but every single call site ignores its return value so probably not worth it.

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