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

Warning under mingw32-x86_64 #42

Closed
thefallentree opened this issue Nov 23, 2019 · 1 comment
Closed

Warning under mingw32-x86_64 #42

thefallentree opened this issue Nov 23, 2019 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@thefallentree
Copy link

filesystem.hpp: In function 'void ghc::filesystem::detail::create_symlink(const ghc::filesystem::path&, const ghc::filesystem::path&, bool, std::error_code&)':
filesystem.hpp:1605:159: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'ghc::filesystem::detail::CreateSymbolicLinkW_fp' {aka 'unsigned char (*)(const wchar_t*, const wchar_t*, long unsigned int)'} [-Wcast-function-type]
 1605 |     static CreateSymbolicLinkW_fp api_call = reinterpret_cast<CreateSymbolicLinkW_fp>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateSymbolicLinkW"));
      |                                                                                                                                                               ^
filesystem.hpp: In function 'void ghc::filesystem::detail::create_hardlink(const ghc::filesystem::path&, const ghc::filesystem::path&, std::error_code&)':
filesystem.hpp:1622:147: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'ghc::filesystem::detail::CreateHardLinkW_fp' {aka 'unsigned char (*)(const wchar_t*, const wchar_t*, _SECURITY_ATTRIBUTES*)'} [-Wcast-function-type]
 1622 |     static CreateHardLinkW_fp api_call = reinterpret_cast<CreateHardLinkW_fp>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateHardLinkW"));

Should probably use static_cast<> instead

@gulrak gulrak added the duplicate This issue or pull request already exists label Nov 23, 2019
@gulrak
Copy link
Owner

gulrak commented Nov 23, 2019

That issue is handled in #38, and the warning should be gone on current master.

@gulrak gulrak closed this as completed Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants