Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A warning may be fixed #116

Open
SodiumCyanide opened this issue Jul 21, 2019 · 3 comments
Open

A warning may be fixed #116

SodiumCyanide opened this issue Jul 21, 2019 · 3 comments

Comments

@SodiumCyanide
Copy link

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

@agauniyal
Copy link
Owner

I think its supposed to give a warning here but if you know a better solution I'd be glad to merge it.

@SodiumCyanide
Copy link
Author

Well... Actually I have no idea about how to fix it. It seems that it's a previous problem in Windows API. I should ignore tons of warnings from MSVC library. :)

@SodiumCyanide
Copy link
Author

@agauniyal I pulled a request for the fixed version of this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants