• 64-bit time_t type in DJ 2.05?

    From Frank Sapone@21:1/5 to All on Thu May 5 10:09:49 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DJ Delorie@21:1/5 to djgpp@delorie.com on Thu May 5 13:09:09 2022
    "Frank Sapone (fhsapone@windstream.net) [via djgpp@delorie.com]" <djgpp@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)