Reply to post: Re: 2038

Y2K quick-fix crick? 1920s come roaring back after mystery blip at UK's vehicle licensing agency

Paul Crawford Silver badge

Re: 2038

Really?

I have done so in C quite happily for 32-bit code in DOS, Windows (compilers 6.0 and 2018), Linux (32 and 64-bit), and in the past Solaris. And it all works.

Try this:

#include <stdint.h>

#include <stdio.h>

int main()

{

uint32_t uu;

int32_t ii = -1;

uu = (unsigned)ii;

if(ii == uu) printf("test 1 OK\n");

if(uu == (unsigned)-1) printf("test 2 OK\n");

return 0;

}

$ gcc -Wall itest.c -o itest

./itest

test 1 OK

test 2 OK

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon