bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Bad timestamps on MinGW32


From: Orgad Shaneh
Subject: [PATCH] Bad timestamps on MinGW32
Date: Wed, 2 Nov 2022 18:32:49 +0200

Commit 01142a53c9d (Add support for intmax_t) added support for 64-bit
time_t by defining __MINGW_USE_VC2005_COMPAT. But this only works with
_stat64 as expected. When stat is used on 32-bit systems, it returns a
bad timestamp (for example, 72586185920376753).

This triggers the following errors every time make is executed:
mingw32-make: Warning: File 'Makefile' has modification time 7.3e+16 s
in the future
mingw32-make: warning:  Clock skew detected.  Your build may be incomplete.

and of course, dependencies are completely broken.

Fix by enabling _stat64 also for MinGW.
---
 src/remake.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/remake.c b/src/remake.c
index 4ce3d2a3..83b0b79d 100644
--- a/src/remake.c
+++ b/src/remake.c
@@ -37,7 +37,7 @@ this program.  If not, see
<https://www.gnu.org/licenses/>.  */
 #include <windows.h>
 #include <io.h>
 #include <sys/stat.h>
-#if defined(_MSC_VER) && _MSC_VER > 1200
+#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER > 1200)
 /* VC7 or later supprots _stat64 to access 64-bit file size. */
 #define STAT _stat64
 #else
--
2.38.1.windows.1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]