Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

64-bit time_t type in DJ 2.05?

13 views
Skip to first unread message

Frank Sapone

unread,
May 5, 2022, 10:10:02 AM5/5/22
to
Hello,

I was running my code through PVS studio while cross-compiling DJGPP
2.05 with GCC 5.1.0 and it had this to say: "Please note that the size
of the 'time_t' type is not 64 bits. After year 2038, the program will
work incorrectly."

Here is my code:

" struct stat info;
if (stat(path, &info) != 0)
return;

time_t t = info.st_mtime;
"

Does DJGPP support some sort of 64-bit time_t type? The code snippet in
question is for getting the date and time modified of a file.

Thanks,
Frank

DJ Delorie

unread,
May 5, 2022, 1:09:24 PM5/5/22
to dj...@delorie.com
"Frank Sapone (fhsa...@windstream.net) [via dj...@delorie.com]"
<dj...@delorie.com> writes:
> Does DJGPP support some sort of 64-bit time_t type?

No.

We actually considered this back when we were writing the 2.0 C library,
and decided that (1) it would break too many programs (then), and (2) if
anyone was still using MS-DOS in 2038, they could fix it ;-)

We also considered an unsigned time_t, which moves the problem to 2164,
but that would have broken other programs.
0 new messages