BUG: TYPES.H time_t Definition Is Incorrect

Last reviewed: July 17, 1997
Article ID: Q102215
1.00 1.50 1.51 WINDOWS kbref kbbuglist

The information in this article applies to:

  • The C Run-time (CRT), included with: Microsoft Visual C++ for Windows, versions 1.0, 1.5, and 1.51

SYMPTOMS

The Microsoft Visual C++ run-time library time functions, such as mktime(), use the time_t data type which is defined in TIME.H as a long. However, the SYS\TYPES.H file incorrectly defines the time_t data type as an unsigned long.

RESOLUTION

Perform one of the following two steps to work around this problem:

  • Modify the SYS\TYPES.H file to modify the time_t definition from unsigned long to long

    -or-

  • Include TIME.H before SYS\TYPES.H to use the correct time_t definition

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This information does not apply to Microsoft C/C++ version 7.0 because the TIME.H and SYS\TYPES.H file each define time_t as an unsigned long. Nor does it apply to Microsoft C versions 6.0x or Microsoft Visual C++ 32-bit Edition because the TIME.H and SYS\TYPES.H file each define time_t as a long.

For additional information about the differences between the time_t data type in C versions 6.0x and the time_t data type in C/C++ version 7.0, please query in the Microsoft Knowledge Base on the following words:

   time function changes gmt


Additional reference words: 6.00 7.00 1.00 1.50
KBCategory: kbref kbbuglist
KBSubcategory: CRTIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.