Skip to content

Warning on cast from farproc_t in Clang 19.1 for Windows #259

Closed
@joaquintides

Description

@joaquintides

This problem arises on Boost.Unordered tests with Clang 19.1 for Visual Studio 2022 v17.13.3 (clang-cl). Full logs here.

2025-03-12T16:47:36.5368174Z .\boost/interprocess/detail/win32_api.hpp(1122,59): error: cast from 'farproc_t' (aka 'int (*)() __attribute__((stdcall))') to 'NtQuerySystemInformation_t' (aka 'long (*)(int, void *, unsigned long, unsigned long *) __attribute__((stdcall))') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
2025-03-12T16:47:36.5371616Z  1122 |    NtQuerySystemInformation_t pNtQuerySystemInformation = reinterpret_cast<NtQuerySystemInformation_t>
2025-03-12T16:47:36.5373049Z       |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-03-12T16:47:36.5373933Z  1123 |          (dll_func::get(dll_func::NtQuerySystemInformation));

(Same error happens at lines 1122, 1546, 1559, 1570, 1329, 1331, 1403, 1404, 1329 of boost/interprocess/detail/win32_api.hpp. ) This seems to be connected to this issue: if this is the case, an intermediate cast tp void * should suffice to silent the warning.

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