Skip to content

clang-tidy: bugprone-multi-level-implicit-pointer-conversion should ignore malloc/calloc/realloc/free #140659

Open
@seanm

Description

@seanm

clang-tidy's bugprone-multi-level-implicit-pointer-conversion gives 48 warnings in my codebase. None are actual bugs. All but 2 of them are warning about malloc/calloc/realloc/reallocf/free.

Seems to me that warnings on these functions is not often going to be useful:

  • malloc returns void*, but usually you're not assigning to an actual void*
  • free takes void*, but often one passes some specific type, not an actual void*

Might it be appropriate to not issue such warnings when these function are involved?

Or perhaps add on option allowing such functions to be listed for suppression?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions