Skip to content

A warning may be fixedΒ #116

@SodiumCyanide

Description

@SodiumCyanide

When I used parameter -Wextra in g++, it gives a warning:

[Warning] cast between incompatible function types from 'FARPROC' {aka 'long long int ()()'} to 'WINBOOL ()(HANDLE, FILE_INFO_BY_HANDLE_CLASS, LPVOID, DWORD)' {aka 'int ()(void, _FILE_INFO_BY_HANDLE_CLASS, void*, long unsigned int)'} [-Wcast-function-type]

It's on line 175 in rang.hpp:

inline bool isMsysPty(int fd) noexcept
    {
        // Dynamic load for binary compability with old Windows
        const auto ptrGetFileInformationByHandleEx
          = reinterpret_cast<decltype(&GetFileInformationByHandleEx)>(
            GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
                           "GetFileInformationByHandleEx"));
        if (!ptrGetFileInformationByHandleEx) {
            return false;
        }

All the parameters I used under Windows 10 1903, g++ 8.1.0:
g++ -std=c++2a -Wall -Wextra -Dlocal

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