Skip to content

[readability/casting] false positive with typedef #409

Open

Description

@targos

In Node.js, we have this code that triggers the readability/casting error:

typedef int32_t(NAPI_CDECL* node_api_addon_get_api_version_func)(void);

https://github.com/nodejs/node/blob/6706b22e350490d3e8e697377b5f388df9305aa0/src/node_api_types.h#L8

src/node_api_types.h:8: Using deprecated casting style. Use static_cast<int32_t>(...) instead [readability/casting] [4]

Activity

  1. added this to the 2.1.0 milestone on Nov 27, 2025
  2. aaronliu0130 commented on Nov 27, 2025

    @aaronliu0130
    Member

    Also fails:

    using node_api_addon_get_api_version_func = int32_t(NAPI_CDECL *)(void);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions