NO

Author Topic: time_t 64 bit  (Read 3770 times)

Offline Robert

  • Member
  • *
  • Posts: 247
time_t 64 bit
« on: February 18, 2020, 12:04:20 AM »
#include <time.h>
#include <stdio.h>

int main(void) {
   printf ("sizeof time_t is: %zu\n", sizeof(time_t));
   return 0;
}
Code: [Select]

#include <time.h>
#include <stdio.h>

int main(void) {
   printf ("sizeof time_t is: %zu\n", sizeof(time_t));
   return 0;
}


Compiled with /Tamd64-coff the snippet above prints 4. Microsoft, MinGW and Clang 64 bit compiles print 8.

For potential, not tomorrow not even next week, problem please see

http://en.wikipedia.org/wiki/Year_2038_problem


Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: time_t 64 bit
« Reply #1 on: March 01, 2020, 04:36:46 PM »
I'm aware of this, but since I use an unsigned type for time_t there shouldn't be a big problem until year ~2106 (that I can think of).
Maybe I need to add a 64-bit time_t for compatibility some day, but right now I see more problems...
/Pelle