Pelles C forum

Pelles C => Feature requests => Topic started by: Robert on February 18, 2020, 12:04:20 AM

Title: time_t 64 bit
Post by: Robert 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 (http://en.wikipedia.org/wiki/Year_2038_problem)

Title: Re: time_t 64 bit
Post by: Pelle 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...