gulrak / filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.
MIT License
1.31k stars 168 forks source link

VS2022 MSVC with `/W4` causes `warning C4127: conditional expression is constant` #147

Closed GXTX closed 1 year ago

GXTX commented 2 years ago

Describe the bug gulfs @ cd6805e

include\ghc/filesystem.hpp(2278,1): warning C4127: conditional expression is constant
include\ghc/filesystem.hpp(2336): message : see reference to function template instantiation 'ghc::filesystem::file_status ghc::filesystem::detail::status_from_INFO<WIN32_FILE_ATTRIBUTE_
DATA>(const ghc::filesystem::path &,const INFO *,std::error_code &,uintmax_t *,time_t *)' being compiled [YACardEmu.vcxproj]
          with
          [
              INFO=WIN32_FILE_ATTRIBUTE_DATA
          ]

To Reproduce Compile an application using this with MSVC and /W4 warning level.

Expected behavior Not warn.

Additional context Is it possible to "fix" this or would it be considered a not fix?

gulrak commented 2 years ago

Thx for the report, I'll look into it.

gulrak commented 1 year ago

The symlink detection was not good anyway and is changed in a way that the offending source line doesn't exist anymore.