Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #87325 > unrolled thread

xkcd: Y2K and 2038

Started byLynn McGuire <lynnmcguire5@gmail.com>
First post2022-11-11 14:29 -0600
Last post2022-11-13 12:45 +0000
Articles 20 on this page of 21 — 13 participants

Back to article view | Back to comp.lang.c++


Contents

  xkcd: Y2K and 2038 Lynn McGuire <lynnmcguire5@gmail.com> - 2022-11-11 14:29 -0600
    Re: xkcd: Y2K and 2038 Thomas Koenig <tkoenig@netcologne.de> - 2022-11-12 07:36 +0000
      Re: xkcd: Y2K and 2038 Lynn McGuire <lynnmcguire5@gmail.com> - 2022-11-12 01:58 -0600
        Re: xkcd: Y2K and 2038 Thomas Koenig <tkoenig@netcologne.de> - 2022-11-12 08:30 +0000
        Re: xkcd: Y2K and 2038 Muttley@dastardlyhq.com - 2022-11-12 10:00 +0000
        Re: xkcd: Y2K and 2038 David Brown <david.brown@hesbynett.no> - 2022-11-12 11:29 +0100
          Re: xkcd: Y2K and 2038 Bart <bc@freeuk.com> - 2022-11-12 11:03 +0000
            Re: xkcd: Y2K and 2038 David Brown <david.brown@hesbynett.no> - 2022-11-12 12:57 +0100
              Re: xkcd: Y2K and 2038 Bart <bc@freeuk.com> - 2022-11-12 15:56 +0000
          Re: xkcd: Y2K and 2038 Michael S <already5chosen@yahoo.com> - 2022-11-12 10:05 -0800
        Re: xkcd: Y2K and 2038 scott@slp53.sl.home (Scott Lurndal) - 2022-11-12 16:05 +0000
        Re: xkcd: Y2K and 2038 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-12 18:00 -0800
          Re: xkcd: Y2K and 2038 red floyd <no.spam.here@its.invalid> - 2022-11-13 09:49 -0800
            Re: xkcd: Y2K and 2038 gazelle@shell.xmission.com (Kenny McCormack) - 2022-11-14 09:14 +0000
          Re: xkcd: Y2K and 2038 David Brown <david.brown@hesbynett.no> - 2022-11-14 10:09 +0100
            Re: xkcd: Y2K and 2038 Thomas Koenig <tkoenig@netcologne.de> - 2022-11-14 14:09 +0000
          Re: xkcd: Y2K and 2038 Klaus Wacker <klaus.w.wacker@t-online.de> - 2022-11-14 13:47 +0000
      Re: xkcd: Y2K and 2038 Paavo Helde <eesnimi@osa.pri.ee> - 2022-11-12 16:13 +0200
        Re: xkcd: Y2K and 2038 Siri Cruise <chine.bleu@yahoo.com> - 2022-11-12 15:49 -0700
      Re: xkcd: Y2K and 2038 Siri Cruise <chine.bleu@yahoo.com> - 2022-11-12 15:47 -0700
    Re: xkcd: Y2K and 2038 Klaus Wacker <klaus.w.wacker@t-online.de> - 2022-11-13 12:45 +0000

Page 1 of 2  [1] 2  Next page →


#87325 — xkcd: Y2K and 2038

FromLynn McGuire <lynnmcguire5@gmail.com>
Date2022-11-11 14:29 -0600
Subjectxkcd: Y2K and 2038
Message-ID<tkmbc4$uc0u$1@dont-email.me>
xkcd: Y2K and 2038
    https://xkcd.com/2697/

It shouldn't cost more than a trillion dollars or two to investigate this.

Explained at:
    https://www.explainxkcd.com/wiki/index.php/2697:_Y2K_and_2038

Lynn

[toc] | [next] | [standalone]


#87327

FromThomas Koenig <tkoenig@netcologne.de>
Date2022-11-12 07:36 +0000
Message-ID<tknieo$36gkg$2@newsreader4.netcologne.de>
In reply to#87325
Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> xkcd: Y2K and 2038
>     https://xkcd.com/2697/
>
> It shouldn't cost more than a trillion dollars or two to investigate this.

The switchover to 64-bit systems should have done this.  Not sure
that this cost a trillion dollars, but computers usually have a
limited lifetime, so they had to be replaced anyway.

[toc] | [prev] | [next] | [standalone]


#87328

FromLynn McGuire <lynnmcguire5@gmail.com>
Date2022-11-12 01:58 -0600
Message-ID<tknjnl$k9o$1@gioia.aioe.org>
In reply to#87327
On 11/12/2022 1:36 AM, Thomas Koenig wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> xkcd: Y2K and 2038
>>      https://xkcd.com/2697/
>>
>> It shouldn't cost more than a trillion dollars or two to investigate this.
> 
> The switchover to 64-bit systems should have done this.  Not sure
> that this cost a trillion dollars, but computers usually have a
> limited lifetime, so they had to be replaced anyway.

Most software is still 32 bit.  Having the operating system as 64 bit 
helps but it does not solve the problem of the 32 bit software running 
on it.  An unsigned 32 bit integer only gets us to 2106.
    https://en.wikipedia.org/wiki/Year_2038_problem

Porting software to 64 bit is a tremendous work for most software.

Lynn

[toc] | [prev] | [next] | [standalone]


#87329

FromThomas Koenig <tkoenig@netcologne.de>
Date2022-11-12 08:30 +0000
Message-ID<tknljb$36gkg$4@newsreader4.netcologne.de>
In reply to#87328
Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> xkcd: Y2K and 2038
>>>      https://xkcd.com/2697/
>>>
>>> It shouldn't cost more than a trillion dollars or two to investigate this.
>> 
>> The switchover to 64-bit systems should have done this.  Not sure
>> that this cost a trillion dollars, but computers usually have a
>> limited lifetime, so they had to be replaced anyway.
>
> Most software is still 32 bit.  Having the operating system as 64 bit 
> helps but it does not solve the problem of the 32 bit software running 
> on it.  An unsigned 32 bit integer only gets us to 2106.
>     https://en.wikipedia.org/wiki/Year_2038_problem
>
> Porting software to 64 bit is a tremendous work for most software.

UNIX went through that in the mid-nineties to mid-noughties.
It mostly involved cleaning some assumptions about pointer vs. int
size.  Clean code was OK from the start, but to lessen the pain,
most operating systems adopted I4LP8 (integers four bytes, longs
and pointers eight bytes).

The important thing was that the interfaces remained constant at
the API level.

I believe what you're discribing is not 32 vs. 64 bit in general,
but rather a peculiarity of Windows which Microsoft inflicted
on its customers because, well, they could.

[toc] | [prev] | [next] | [standalone]


#87330

FromMuttley@dastardlyhq.com
Date2022-11-12 10:00 +0000
Message-ID<tknqsm$14f0$1@gioia.aioe.org>
In reply to#87328
On Sat, 12 Nov 2022 01:58:44 -0600
Lynn McGuire <lynnmcguire5@gmail.com> wrote:
>On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> xkcd: Y2K and 2038
>>>      https://xkcd.com/2697/
>>>
>>> It shouldn't cost more than a trillion dollars or two to investigate this.
>> 
>> The switchover to 64-bit systems should have done this.  Not sure
>> that this cost a trillion dollars, but computers usually have a
>> limited lifetime, so they had to be replaced anyway.
>
>Most software is still 32 bit.  Having the operating system as 64 bit 
>helps but it does not solve the problem of the 32 bit software running 
>on it.  An unsigned 32 bit integer only gets us to 2106.

I suspect that'll be long enough. The sorts of computers running in 80 years
time will probably bear little resemblence to what we have now.

>    https://en.wikipedia.org/wiki/Year_2038_problem
>
>Porting software to 64 bit is a tremendous work for most software.

Not really as long as the programmer hasn't done something stupid like assuming
the size of int or long instead of using int32_t etc.

[toc] | [prev] | [next] | [standalone]


#87331

FromDavid Brown <david.brown@hesbynett.no>
Date2022-11-12 11:29 +0100
Message-ID<tknsj2$15ad4$2@dont-email.me>
In reply to#87328
On 12/11/2022 08:58, Lynn McGuire wrote:
> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> xkcd: Y2K and 2038
>>>      https://xkcd.com/2697/
>>>
>>> It shouldn't cost more than a trillion dollars or two to investigate 
>>> this.
>>
>> The switchover to 64-bit systems should have done this.  Not sure
>> that this cost a trillion dollars, but computers usually have a
>> limited lifetime, so they had to be replaced anyway.
> 
> Most software is still 32 bit.  Having the operating system as 64 bit 
> helps but it does not solve the problem of the 32 bit software running 
> on it.  An unsigned 32 bit integer only gets us to 2106.
>     https://en.wikipedia.org/wiki/Year_2038_problem
> 
> Porting software to 64 bit is a tremendous work for most software.
> 

Most *nix software has been 64-bit clean for decades.  Most /new/ 
Windows software is 64-bit clean.  A fair bit of modern software on 
Windows is cross-platform, sometimes originating in the *nix world, and 
that will be fine with 64-bit.

The only PC software that has trouble with 64-bit is Windows software 
with a long history, and written with poor code.  Code that assumes 
pointers fit in longs, or that LONG is a suitable type for holding a 
time value, will have trouble.  So yes, that kind of software will be a 
problem - and some of it will still be in use by 2038.

There will be some local problems within company-specific software - but 
there are /always/ problems with company specific software as 
requirements change and assumptions are no longer valid.  I don't 
foresee Y2038 being specially problematic.

For embedded software, this will not be much of an issue.  The great 
majority of embedded software doesn't have any need of dates or long 
timings.  For small systems that /do/ need dates or long times, it's 
common to have your own formats to keep track - it's far smaller code to 
increment a second/minute/hour/day/month/year tracker every second, than 
to deal with the mess of leap seconds, locales, and other complications 
of converting UNIX epoch to local time.

Also, good embedded developers take overflows into account all the time. 
  They are more likely to see a 32-bit millisecond counter than a second 
counter, and that overflows after 49 days - it is something you 
understand and you make sure the code does not fail after 49 days.

My only real concern about Y2038 is excessive paranoia and bureaucracy. 
I expect to be inundated with requirements to document that some 
flashing light we made in 1990 does not suffer from Y2038 problems.


[toc] | [prev] | [next] | [standalone]


#87332

FromBart <bc@freeuk.com>
Date2022-11-12 11:03 +0000
Message-ID<tknui8$kmo$1@gioia.aioe.org>
In reply to#87331
On 12/11/2022 10:29, David Brown wrote:
> On 12/11/2022 08:58, Lynn McGuire wrote:
>> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>>> xkcd: Y2K and 2038
>>>>      https://xkcd.com/2697/
>>>>
>>>> It shouldn't cost more than a trillion dollars or two to investigate 
>>>> this.
>>>
>>> The switchover to 64-bit systems should have done this.  Not sure
>>> that this cost a trillion dollars, but computers usually have a
>>> limited lifetime, so they had to be replaced anyway.
>>
>> Most software is still 32 bit.  Having the operating system as 64 bit 
>> helps but it does not solve the problem of the 32 bit software running 
>> on it.  An unsigned 32 bit integer only gets us to 2106.
>>     https://en.wikipedia.org/wiki/Year_2038_problem
>>
>> Porting software to 64 bit is a tremendous work for most software.
>>
> 
> Most *nix software has been 64-bit clean for decades.  Most /new/ 
> Windows software is 64-bit clean.  A fair bit of modern software on 
> Windows is cross-platform, sometimes originating in the *nix world, and 
> that will be fine with 64-bit.

The size of C 'int' on the Windows and Linux systems I have encountered 
still seems to be stuck on 32 bits.

Which means people lazily using that instead of `int64_t` etc, or using 
is as a "don't care" type, are continuing to perpetuate 32-bit-dominated 
software.

> The only PC software that has trouble with 64-bit is Windows software 
> with a long history, and written with poor code.  Code that assumes 
> pointers fit in longs, or that LONG is a suitable type for holding a 
> time value, will have trouble.  So yes, that kind of software will be a 
> problem - and some of it will still be in use by 2038.

It is the 'long' type that is problematic. On Windows that is at least 
consistently 32 bits on Win32 and Win64 systems. If you assume it is the 
same size as `void*`, you will quickly discover it isn't on Win64.

On Linux, I think it is 32 bits on Linux32 and 64 bits on Linux64, so 
any assumptions about it there will have more subtle consequences.

[toc] | [prev] | [next] | [standalone]


#87333

FromDavid Brown <david.brown@hesbynett.no>
Date2022-11-12 12:57 +0100
Message-ID<tko1mv$15ij4$1@dont-email.me>
In reply to#87332
On 12/11/2022 12:03, Bart wrote:
> On 12/11/2022 10:29, David Brown wrote:
>> On 12/11/2022 08:58, Lynn McGuire wrote:
>>> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>>>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>>>> xkcd: Y2K and 2038
>>>>>      https://xkcd.com/2697/
>>>>>
>>>>> It shouldn't cost more than a trillion dollars or two to 
>>>>> investigate this.
>>>>
>>>> The switchover to 64-bit systems should have done this.  Not sure
>>>> that this cost a trillion dollars, but computers usually have a
>>>> limited lifetime, so they had to be replaced anyway.
>>>
>>> Most software is still 32 bit.  Having the operating system as 64 bit 
>>> helps but it does not solve the problem of the 32 bit software 
>>> running on it.  An unsigned 32 bit integer only gets us to 2106.
>>>     https://en.wikipedia.org/wiki/Year_2038_problem
>>>
>>> Porting software to 64 bit is a tremendous work for most software.
>>>
>>
>> Most *nix software has been 64-bit clean for decades.  Most /new/ 
>> Windows software is 64-bit clean.  A fair bit of modern software on 
>> Windows is cross-platform, sometimes originating in the *nix world, 
>> and that will be fine with 64-bit.
> 
> The size of C 'int' on the Windows and Linux systems I have encountered 
> still seems to be stuck on 32 bits.
> 
> Which means people lazily using that instead of `int64_t` etc, or using 
> is as a "don't care" type, are continuing to perpetuate 32-bit-dominated 
> software.

There's nothing wrong with using 32-bit types.  The problem only comes 
when you use a 32-bit type for something that might not fit in 32 bits. 
So if there are people using "int" for "time_t", pointers, or other 
things that are unsuitable, then that's a problem.

Otherwise, it's fine to use 32-bit types for 32-bit values.  It is often 
/better/, because it makes better use of cache (obviously this matters 
most for arrays) and memory bus bandwidth, it can be faster for some 
operations, and allows more use of SIMD operations.

> 
>> The only PC software that has trouble with 64-bit is Windows software 
>> with a long history, and written with poor code.  Code that assumes 
>> pointers fit in longs, or that LONG is a suitable type for holding a 
>> time value, will have trouble.  So yes, that kind of software will be 
>> a problem - and some of it will still be in use by 2038.
> 
> It is the 'long' type that is problematic. On Windows that is at least 
> consistently 32 bits on Win32 and Win64 systems. If you assume it is the 
> same size as `void*`, you will quickly discover it isn't on Win64.

Windows programmers were used to assuming that "long" meant "32-bit", 
and that "long" was the same size as pointers.  MS could only make one 
of these assumptions remain when they moved to 64-bit - they picked the 
wrong one.  (It was especially wrong given that their C compiler didn't 
support C99 and "long long int" at the time, and had no proper 64-bit 
integer type!)

> 
> On Linux, I think it is 32 bits on Linux32 and 64 bits on Linux64, so 
> any assumptions about it there will have more subtle consequences.
> 

In the *nix world, programmers have /long/ been used to avoiding such 
assumptions.  The idea of having everything as a single platform that 
never changes, so you can pretend the basic C types have particular 
fixed characteristics, or assume platform endianness, or strong memory 
models - that's all from the DOS/Windows world.  You can't blame Linux 
for the problems MS caused by picking solutions that are different from 
everyone else, or caused by DOS/Windows programmers writing crap code 
for decades.


[toc] | [prev] | [next] | [standalone]


#87337

FromBart <bc@freeuk.com>
Date2022-11-12 15:56 +0000
Message-ID<tkofn4$1oac$1@gioia.aioe.org>
In reply to#87333
On 12/11/2022 11:57, David Brown wrote:
> On 12/11/2022 12:03, Bart wrote:
>> On 12/11/2022 10:29, David Brown wrote:
>>> On 12/11/2022 08:58, Lynn McGuire wrote:
>>>> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>>>>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>>>>> xkcd: Y2K and 2038
>>>>>>      https://xkcd.com/2697/
>>>>>>
>>>>>> It shouldn't cost more than a trillion dollars or two to 
>>>>>> investigate this.
>>>>>
>>>>> The switchover to 64-bit systems should have done this.  Not sure
>>>>> that this cost a trillion dollars, but computers usually have a
>>>>> limited lifetime, so they had to be replaced anyway.
>>>>
>>>> Most software is still 32 bit.  Having the operating system as 64 
>>>> bit helps but it does not solve the problem of the 32 bit software 
>>>> running on it.  An unsigned 32 bit integer only gets us to 2106.
>>>>     https://en.wikipedia.org/wiki/Year_2038_problem
>>>>
>>>> Porting software to 64 bit is a tremendous work for most software.
>>>>
>>>
>>> Most *nix software has been 64-bit clean for decades.  Most /new/ 
>>> Windows software is 64-bit clean.  A fair bit of modern software on 
>>> Windows is cross-platform, sometimes originating in the *nix world, 
>>> and that will be fine with 64-bit.
>>
>> The size of C 'int' on the Windows and Linux systems I have 
>> encountered still seems to be stuck on 32 bits.
>>
>> Which means people lazily using that instead of `int64_t` etc, or 
>> using is as a "don't care" type, are continuing to perpetuate 
>> 32-bit-dominated software.
> 
> There's nothing wrong with using 32-bit types.

I think there is. You would question code, running on a PC where 'int' 
was i32, that specifically used int16_t everywhere for parameters, 
return types, and individual global and local variables for no 
particular reason.

Since it's not really going to save space.

Outside of C, I would only use an i32 type for the same reason I might 
choose i16 or i8: to optimise storage and layout for arrays and structs, 
or as the target of a pointer into such a structure.

Otherwise there is little point on a 64-bit system where registers and 
stack slots are 64 bits anyway. Especially as a 32-bit int is 4 billion 
times more likely to overflow.

[toc] | [prev] | [next] | [standalone]


#87339

FromMichael S <already5chosen@yahoo.com>
Date2022-11-12 10:05 -0800
Message-ID<a4db5635-874c-4f9f-be54-256191c62654n@googlegroups.com>
In reply to#87331
On Saturday, November 12, 2022 at 12:30:12 PM UTC+2, David Brown wrote:
> On 12/11/2022 08:58, Lynn McGuire wrote: 
> > On 11/12/2022 1:36 AM, Thomas Koenig wrote: 
> >> Lynn McGuire <lynnmc...@gmail.com> schrieb: 
> >>> xkcd: Y2K and 2038 
> >>>      https://xkcd.com/2697/ 
> >>> 
> >>> It shouldn't cost more than a trillion dollars or two to investigate 
> >>> this. 
> >> 
> >> The switchover to 64-bit systems should have done this.  Not sure 
> >> that this cost a trillion dollars, but computers usually have a 
> >> limited lifetime, so they had to be replaced anyway. 
> > 
> > Most software is still 32 bit.  Having the operating system as 64 bit 
> > helps but it does not solve the problem of the 32 bit software running 
> > on it.  An unsigned 32 bit integer only gets us to 2106. 
> >    https://en.wikipedia.org/wiki/Year_2038_problem 
> > 
> > Porting software to 64 bit is a tremendous work for most software. 
> >
> Most *nix software has been 64-bit clean for decades. Most /new/ 
> Windows software is 64-bit clean. A fair bit of modern software on 
> Windows is cross-platform, sometimes originating in the *nix world, and 
> that will be fine with 64-bit. 
> 
> The only PC software that has trouble with 64-bit is Windows software 
> with a long history, and written with poor code. Code that assumes 
> pointers fit in longs, or that LONG is a suitable type for holding a 
> time value, will have trouble. So yes, that kind of software will be a 
> problem - and some of it will still be in use by 2038. 
> 

Native 32-bit Windows software should have no problems, because native
Windows time APIs never counted time as seconds starting form 1970.
Only *nix programs that were ported to Win32 too literally can became 
problematic, but more likely not in 2038, but when all 32 bits wrap around
in 2106.

> There will be some local problems within company-specific software - but 
> there are /always/ problems with company specific software as 
> requirements change and assumptions are no longer valid. I don't 
> foresee Y2038 being specially problematic. 
> 
> For embedded software, this will not be much of an issue. The great 
> majority of embedded software doesn't have any need of dates or long 
> timings. For small systems that /do/ need dates or long times, it's 
> common to have your own formats to keep track - it's far smaller code to 
> increment a second/minute/hour/day/month/year tracker every second, than 
> to deal with the mess of leap seconds, locales, and other complications 
> of converting UNIX epoch to local time. 
> 
> Also, good embedded developers take overflows into account all the time. 
> They are more likely to see a 32-bit millisecond counter than a second 
> counter, and that overflows after 49 days - it is something you 
> understand and you make sure the code does not fail after 49 days. 
> 
> My only real concern about Y2038 is excessive paranoia and bureaucracy. 
> I expect to be inundated with requirements to document that some 
> flashing light we made in 1990 does not suffer from Y2038 problems.

Many people made money from paranoia of Y2K. They or their children
are interested in doing it again.

[toc] | [prev] | [next] | [standalone]


#87338

Fromscott@slp53.sl.home (Scott Lurndal)
Date2022-11-12 16:05 +0000
Message-ID<%uPbL.5610$gBW5.3856@fx06.iad>
In reply to#87328
Lynn McGuire <lynnmcguire5@gmail.com> writes:
>On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> xkcd: Y2K and 2038
>>>      https://xkcd.com/2697/
>>>
>>> It shouldn't cost more than a trillion dollars or two to investigate this.
>> 
>> The switchover to 64-bit systems should have done this.  Not sure
>> that this cost a trillion dollars, but computers usually have a
>> limited lifetime, so they had to be replaced anyway.
>
>Most software is still 32 bit. 

In what year?   That's certainly not the case today,
and it will be even less so by 2038.

And how much of that software uses time_t?

[toc] | [prev] | [next] | [standalone]


#87343

FromKeith Thompson <Keith.S.Thompson+u@gmail.com>
Date2022-11-12 18:00 -0800
Message-ID<87mt8vlila.fsf@nosuchdomain.example.com>
In reply to#87328
Lynn McGuire <lynnmcguire5@gmail.com> writes:

> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>> xkcd: Y2K and 2038
>>>      https://xkcd.com/2697/
>>>
>>> It shouldn't cost more than a trillion dollars or two to investigate this.
>> The switchover to 64-bit systems should have done this.  Not sure
>> that this cost a trillion dollars, but computers usually have a
>> limited lifetime, so they had to be replaced anyway.
>
> Most software is still 32 bit.  Having the operating system as 64 bit
> helps but it does not solve the problem of the 32 bit software running 
> on it.  An unsigned 32 bit integer only gets us to 2106.
>    https://en.wikipedia.org/wiki/Year_2038_problem
>
> Porting software to 64 bit is a tremendous work for most software.

An unsigned time_t makes it impossible to represent times before 1970.
Not all software is going to care about that, but in my opinion it's
an unacceptable price.

There are still 32-bit systems and environments.  On my 64-bit Ubuntu
system I can compile with `gcc -m32` and get 32-bit pointers and time_t.

But since C and C++ require support for 64-bit integers anyway, it
should be practical to require 64-bit time_t even on 32-bit systems.
(Not sure about Fortran.)

The real problem is going to be 32-bit (or smaller) embedded systems
whose software can't be updated.  On the other hand, a lot of such
systems probably don't care what time it is.

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

[toc] | [prev] | [next] | [standalone]


#87350

Fromred floyd <no.spam.here@its.invalid>
Date2022-11-13 09:49 -0800
Message-ID<tkrao1$1ghql$1@redfloyd.dont-email.me>
In reply to#87343
On 11/12/2022 6:00 PM, Keith Thompson wrote:
>   On the other hand, a lot of such
> systems probably don't care what time it is.

Why am I thinking of Chicago now?

[toc] | [prev] | [next] | [standalone]


#87357

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2022-11-14 09:14 +0000
Message-ID<tkt0t0$13ho$2@news.xmission.com>
In reply to#87350
In article <tkrao1$1ghql$1@redfloyd.dont-email.me>,
red floyd  <no.spam.here@its.invalid> wrote:
>On 11/12/2022 6:00 PM, Keith Thompson wrote:
>>   On the other hand, a lot of such
>> systems probably don't care what time it is.
>
>Why am I thinking of Chicago now?
>

03:35, 03;34, whatever...

-- 
The randomly chosen signature file that would have appeared here is more than 4
lines long.  As such, it violates one or more Usenet RFCs.  In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
	http://user.xmission.com/~gazelle/Sigs/Voltaire

[toc] | [prev] | [next] | [standalone]


#87356

FromDavid Brown <david.brown@hesbynett.no>
Date2022-11-14 10:09 +0100
Message-ID<tkt0kg$1nldh$1@dont-email.me>
In reply to#87343
On 13/11/2022 03:00, Keith Thompson wrote:
> Lynn McGuire <lynnmcguire5@gmail.com> writes:
> 
>> On 11/12/2022 1:36 AM, Thomas Koenig wrote:
>>> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>>>> xkcd: Y2K and 2038
>>>>       https://xkcd.com/2697/
>>>>
>>>> It shouldn't cost more than a trillion dollars or two to investigate this.
>>> The switchover to 64-bit systems should have done this.  Not sure
>>> that this cost a trillion dollars, but computers usually have a
>>> limited lifetime, so they had to be replaced anyway.
>>
>> Most software is still 32 bit.  Having the operating system as 64 bit
>> helps but it does not solve the problem of the 32 bit software running
>> on it.  An unsigned 32 bit integer only gets us to 2106.
>>     https://en.wikipedia.org/wiki/Year_2038_problem
>>
>> Porting software to 64 bit is a tremendous work for most software.
> 
> An unsigned time_t makes it impossible to represent times before 1970.
> Not all software is going to care about that, but in my opinion it's
> an unacceptable price.

For the solid majority of programs that use Unix epoch times, unsigned 
would be fine.  There can't be many programs that need dates before 1970 
but are happy to think the world started in late 1901 - Unix epoch times 
are almost always considered as time after 01.01.1970.  However, as long 
as there are /some/ programs that need negative epoch times, you can't 
break that functionality.

> 
> There are still 32-bit systems and environments.  On my 64-bit Ubuntu
> system I can compile with `gcc -m32` and get 32-bit pointers and time_t.
> 

I think I heard that the next Ubuntu would not have 32-bit libraries in 
its normal repositories any more.  That won't stop them being available 
for those that need them.  (I think I only need 32-bit libraries on 
Linux in connection with Wine and 32-bit Windows programs.)

More modern Linux (since kernel 5.6, according to Wikipedia) systems 
have 64-bit time_t even on 32-bit builds.

> But since C and C++ require support for 64-bit integers anyway, it
> should be practical to require 64-bit time_t even on 32-bit systems.

Yes.

> (Not sure about Fortran.)

(That's better than me - I haven't a clue about Fortran!)

> 
> The real problem is going to be 32-bit (or smaller) embedded systems
> whose software can't be updated.  On the other hand, a lot of such
> systems probably don't care what time it is.
> 

Pretty much any non-trivial embedded system will care a bit about time, 
but usually only relative time - blink every second, send a message 
every hour, or whatever.  These might have a 32-bit second counter, but 
are more likely to have millisecond counters or higher resolution.  And 
they generally take overflow into account by simply subtracting start 
times and current times (generally assuming two's complement wrapping 
overflow...).  Millisecond 32-bit counters overflow after 49 days, so it 
is something you think about more than 69 year overflows.

Small embedded systems which also track the date will generally not do 
so using Unix epoch timestamps - it's a lot easier to hold a structure 
with second, minute, hour, day, month, year fields and update it.  That 
avoids all the mess of locales and time and date conversions.

Bigger embedded systems are more likely to be updatable - though that 
does not mean they /will/ be updated.  Manufacturers might provide 
updates for a few years or while the product is still being made and 
sold, but after that they may not bother.

There will be some systems that are a problem - but I do not expect it 
to be a widespread issue.

[toc] | [prev] | [next] | [standalone]


#87374

FromThomas Koenig <tkoenig@netcologne.de>
Date2022-11-14 14:09 +0000
Message-ID<tkti7i$3acek$1@newsreader4.netcologne.de>
In reply to#87356
David Brown <david.brown@hesbynett.no> schrieb:
> On 13/11/2022 03:00, Keith Thompson wrote:

>> But since C and C++ require support for 64-bit integers anyway, it
>> should be practical to require 64-bit time_t even on 32-bit systems.
>
> Yes.
>
>> (Not sure about Fortran.)
>
> (That's better than me - I haven't a clue about Fortran!)

Fortran has the DATE_AND_TIME inrinsic, which returns the the date
and time in calendar format, either as YYYYMMDD and HHMMSS.SSS and
[+/-] HHMM for the zoneif you chose character arguments, or as an
array of integer with the same info.

The library is supposed to take care of how to get the value
from the operating system, user programs need not bother.

There are also non-standard extensions which mimic system
behavior, but those should be avoided, at least in new code.

[toc] | [prev] | [next] | [standalone]


#87373

FromKlaus Wacker <klaus.w.wacker@t-online.de>
Date2022-11-14 13:47 +0000
Message-ID<jtev7mFoio3U1@mid.individual.net>
In reply to#87343
In comp.lang.fortran Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
[...]
> 
> An unsigned time_t makes it impossible to represent times before 1970.
> Not all software is going to care about that, but in my opinion it's
> an unacceptable price.
>

I read somewhere that the reason for a signed time_t was mainly that
this type was nor just used for time stamps, but also for time
differences.

-- 
Klaus Wacker         klaus.w.wacker@t-online.de
51°29'7"N 7°25'7"E

[toc] | [prev] | [next] | [standalone]


#87334

FromPaavo Helde <eesnimi@osa.pri.ee>
Date2022-11-12 16:13 +0200
Message-ID<tko9lc$168q6$1@dont-email.me>
In reply to#87327
12.11.2022 09:36 Thomas Koenig kirjutas:
> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
>> xkcd: Y2K and 2038
>>      https://xkcd.com/2697/
>>
>> It shouldn't cost more than a trillion dollars or two to investigate this.
> 
> The switchover to 64-bit systems should have done this.  Not sure
> that this cost a trillion dollars, but computers usually have a
> limited lifetime, so they had to be replaced anyway.

64-bit system does not help if the program does not use it. At least 
boost xtime used to have 'long' counters, which indeed are 64-bit in 
some 64-bit implementations, but not so in others. Not sure about their 
current state, I have phased boost::xtime out in preparation for Y2038.

[toc] | [prev] | [next] | [standalone]


#87341

FromSiri Cruise <chine.bleu@yahoo.com>
Date2022-11-12 15:49 -0700
Message-ID<chine.bleu-787EC3.15494212112022@news.eternal-september.org>
In reply to#87334
In article <tko9lc$168q6$1@dont-email.me>,
 Paavo Helde <eesnimi@osa.pri.ee> wrote:

> 12.11.2022 09:36 Thomas Koenig kirjutas:
> > Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> >> xkcd: Y2K and 2038
> >>      https://xkcd.com/2697/
> >>
> >> It shouldn't cost more than a trillion dollars or two to investigate this.
> > 
> > The switchover to 64-bit systems should have done this.  Not sure
> > that this cost a trillion dollars, but computers usually have a
> > limited lifetime, so they had to be replaced anyway.
> 
> 64-bit system does not help if the program does not use it. At least 
> boost xtime used to have 'long' counters, which indeed are 64-bit in 
> some 64-bit implementations, but not so in others. Not sure about their 
> current state, I have phased boost::xtime out in preparation for Y2038.

I use double which gives me subsecond resolution for millions of 
years.

-- 
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted.    @
'I desire mercy, not sacrifice.'                                    /|\
Discordia: not just a religion but also a parody. This post         / \
I am an Andrea Chen sockpuppet.                  insults Islam.  Mohammed

[toc] | [prev] | [next] | [standalone]


#87340

FromSiri Cruise <chine.bleu@yahoo.com>
Date2022-11-12 15:47 -0700
Message-ID<chine.bleu-638BA8.15474312112022@news.eternal-september.org>
In reply to#87327
In article <tknieo$36gkg$2@newsreader4.netcologne.de>,
 Thomas Koenig <tkoenig@netcologne.de> wrote:

> Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
> > xkcd: Y2K

That's Y2K38.

> >     https://xkcd.com/2697/
> >
> > It shouldn't cost more than a trillion dollars or two to investigate this.
> 
> The switchover to 64-bit systems should have done this.  Not sure
> that this cost a trillion dollars, but computers usually have a
> limited lifetime, so they had to be replaced anyway.

The problem is the all the archival formats that knew 32 bit 
would always be enough.

-- 
:-<> Siri Seal of Disavowal #000-001. Disavowed. Denied. Deleted.    @
'I desire mercy, not sacrifice.'                                    /|\
Discordia: not just a religion but also a parody. This post         / \
I am an Andrea Chen sockpuppet.                  insults Islam.  Mohammed

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.c++


csiph-web