[MinGW-Notify] [mingw] #37938: Conflicts in time_t type definition between MSVCRT.DLL, UCRTBASE.DLL, and VC++ non-free runtimes

Back to archive index

MinGW Notification List mingw****@lists*****
Sun Feb 11 06:32:14 JST 2018


#37938: Conflicts in time_t type definition between MSVCRT.DLL, UCRTBASE.DLL, and VC++ non-free runtimes

  Open Date: 2018-02-03 18:05
Last Update: 2018-02-10 21:32

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/37938
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=37938

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2018-02-10 21:32 Updated by: keith

Comment:

Fundamentally, this issue revolves around the implementations of the following 13 generically named functions:
ctime
difftime
_ftime
_futime
gmtime
localtime
_mkgmtime
mktime
time
utime
_utime
_wctime
_wutime
Every one of these is physically implemented within, and exported by, MSVCRT.DLL, (both 32-bit and 64-bit versions, AFAICT).  None of them are physically present within UCRTBASE.DLL, nor in MSVCR80.DLL, (nor in any of its successors); each is provided by in-line redirection, to either a 32-bit or 64-bit time_t specific equivalents, as specified within appropriate header files, and as directed by user specification, or otherwise, of the _USE_32BIT_TIME_T feature test.
On the 32-bit Windows platform, the attached `chktime.c` program unequivocally demonstrates that, in the case of the time() function, the MSVCRT.DLL implementation always interprets time_t as a 32-bit entity.  On 64-bit Windows it may become a 64-bit entity, but do not have a platform on which I can test this; thus, I would appreciate if someone with a suitable platform, could, as the first step in a pragmatic investigation, compile `chktime.c` as a 64-bit application, run it, and attach its output here.

---------------------------------------------------------------------
Ticket Status:

      Reporter: keith
         Owner: keith
          Type: Issues
        Status: Open [Owner assigned]
      Priority: 5 - Medium
     MileStone: (None)
     Component: WSL
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

According to this Microsoft on-line documentation:
In versions of Visual C++ and Microsoft C/C++ before Visual C++ 2005, time_t was a long int (32 bits) 
and hence could not be used for dates past 3:14:07 January 19, 2038, UTC.  time_t is now equivalent to 
__time64_t by default, but defining _USE_32BIT_TIME_T changes time_t to __time32_t and forces many time 
functions to call versions that take the 32-bit time_t.  For more information, see Standard Types and 
comments in the documentation for the individual time functions.
While this may be true, for applications which are built using Microsoft's Visual C++, (specifically from the 2005 version onward), and linked with the accompanying non-free versions of Microsoft's C-Runtime library, (from MSVCR80.DLL onward, and perhaps also with the pseudo-free UCRTBASE.DLL), it is manifestly untrue for applications which are linked with the pseudo-free MSVCRT.DLL, (the normal case for MinGW applications), as it is for applications which are built with, and linked with the C-Runtime libraries which accompanied, earlier (legacy) versions of Microsoft's Visual C++, (i.e. applications which are linked with Microsoft's non-free runtime libraries pre-dating MSVCR80.DLL).
We need to engineer a time management API which will accommodate the disparities between MSVCRT.DLL, UCRTBASE.DLL, and Microsoft's post-2005 Visual C++ implementations of various time management functions, and we must recognise that our API cannot blindly conform to the above paragraph from Microsoft's current documentation.


-- 
Ticket information of MinGW - Minimalist GNU for Windows project
MinGW - Minimalist GNU for Windows Project is hosted on OSDN

Project URL: https://osdn.net/projects/mingw/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net//projects/mingw/ticket/37938
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=3917&tid=37938




More information about the MinGW-Notify mailing list
Back to archive index