Closed CookiePLMonster closed 1 year ago
@CookiePLMonster, Please fix the compilation error in Mingw (AppVeyor CI).
[ 5%] Building CXX object test/CMakeFiles/filesystem_test.dir/filesystem_test.cpp.obj
In file included from C:\projects\filesystem\test\filesystem_test.cpp:62:0:
C:/projects/filesystem/include/ghc/filesystem.hpp: In function 'void ghc::filesystem::detail::timeToFILETIME(time_t, FILETIME&)':
C:/projects/filesystem/include/ghc/filesystem.hpp:2245:37: error: conversion to 'ULONGLONG {aka long long unsigned int}' from 'long long int' may change the sign of the result [-Werror=sign-conversion]
ull.QuadPart = (t * 10000000LL) + 116444736000000000LL;
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
cc1plus.exe: all warnings being treated as errors
Thank you for the PR and sorry for the very long delay.
The old code truncated
time_t
to a 32-bit value when using Int32x32To64. This example code has been fixed on MSDN a while ago, so this change only updates it to the current version.While this function is currently unused by ghc, it resides in a public header so someone could have relied on it.
This PR is a part of a mini-project dedicated to fixing Y2038 problems caused by this very code snippet. https://cookieplmonster.github.io/2022/02/17/year-2038-problem/