Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Play Rogue, visit exotic locations, meet strange creatures and kill them.


devel / comp.lang.awk / Re: Y2K38 bug (January 19, 2038)

SubjectAuthor
* Y2K38 bug (January 19, 2038)J Naman
+* Re: Y2K38 bug (January 19, 2038)Geoff Clare
|`* Re: Y2K38 bug (January 19, 2038)Keith Thompson
| +- Re: Y2K38 bug (January 19, 2038)Geoff Clare
| `* Re: Y2K38 bug (January 19, 2038)Mr. Man-wai Chang
|  `* Re: Y2K38 bug (January 19, 2038)Keith Thompson
|   `* Re: Y2K38 bug (January 19, 2038)Geoff Clare
|    +* Re: Y2K38 bug (January 19, 2038)Christian Weisgerber
|    |`* Re: Y2K38 bug (January 19, 2038)Keith Thompson
|    | `* Re: Y2K38 bug (January 19, 2038)Geoff Clare
|    |  `- Re: Y2K38 bug (January 19, 2038)Keith Thompson
|    `- Re: Y2K38 bug (January 19, 2038)Keith Thompson
+- Re: Y2K38 bug (January 19, 2038)Russell Marks
`* Re: Y2K38 bug (January 19, 2038)Kenny McCormack
 `* Re: Y2K38 bug (January 19, 2038)Mr. Man-wai Chang
  +* Re: Y2K38 bug (January 19, 2038)Ben Bacarisse
  |`* Re: Y2K38 bug (January 19, 2038)Mr. Man-wai Chang
  | `- Re: Y2K38 bug (January 19, 2038)Kees Nuyt
  `- Re: Y2K38 bug (January 19, 2038)Keith Thompson

1
Y2K38 bug (January 19, 2038)

<b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1743&group=comp.lang.awk#1743

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:3995:b0:77a:4aa:5502 with SMTP id ro21-20020a05620a399500b0077a04aa5502mr144703qkn.2.1699898573655;
Mon, 13 Nov 2023 10:02:53 -0800 (PST)
X-Received: by 2002:a63:6584:0:b0:5bd:2a10:d396 with SMTP id
z126-20020a636584000000b005bd2a10d396mr1932966pgb.11.1699898573251; Mon, 13
Nov 2023 10:02:53 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Mon, 13 Nov 2023 10:02:52 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=151.200.57.7; posting-account=BcR7vAoAAABY9YgIIYIhD68t7wwjMvJW
NNTP-Posting-Host: 151.200.57.7
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
Subject: Y2K38 bug (January 19, 2038)
From: jnaman2@gmail.com (J Naman)
Injection-Date: Mon, 13 Nov 2023 18:02:53 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 7
X-Received-Bytes: 1594
 by: J Naman - Mon, 13 Nov 2023 18:02 UTC

Is there any plan or schedule for POSIX to replace the Unix 32-bit time by a 64-bit time format to avoid the Y2K38 bug ( January 19, 2038, at 03:14:07 UTC.)? I am really asking if GNU awk or other awks expect to upgrade before or after the next revision of POSIX in 2026? Is there any certainty that POSIX WILL revise time in 2026?
I keep running into Y2K38 issues with some US government data. mktime() is no big deal to handle at the user level, but strftime() IS a (the) real problem.

Re: Y2K38 bug (January 19, 2038)

<o29c2k-0a9.ln1@ID-313840.user.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1745&group=comp.lang.awk#1745

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: geoff@clare.See-My-Signature.invalid (Geoff Clare)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 14 Nov 2023 13:25:12 +0000
Lines: 34
Message-ID: <o29c2k-0a9.ln1@ID-313840.user.individual.net>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
Reply-To: netnews@gclare.org.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net PbsX0L2l8+Wj7hZ/J+KuwgIPN6lv09hhRnkkcYnUoL9lnthJiu
X-Orig-Path: ID-313840.user.individual.net!not-for-mail
Cancel-Lock: sha1:uCxJuJfEhY9q/ohBKPPKE8p62B0= sha256:5gq0vdwdEMdA+/vbBfk4iGbHy08y0lftoLnacaXEUuw=
User-Agent: Pan/0.154 (Izium; 517acf4)
 by: Geoff Clare - Tue, 14 Nov 2023 13:25 UTC

J Naman wrote:

> Is there any plan or schedule for POSIX to replace the Unix 32-bit
> time by a 64-bit time format to avoid the Y2K38 bug ( January 19,
> 2038, at 03:14:07 UTC.)? I am really asking if GNU awk or other awks
> expect to upgrade before or after the next revision of POSIX in 2026?
> Is there any certainty that POSIX WILL revise time in 2026? keep
> running into Y2K38 issues with some US government data. mktime() is
> no big deal to handle at the user level, but strftime() IS a (the)
> real problem.

The current draft of the next POSIX revision has this in the
description of the <sys/types.h> header:

time_t shall be an integer type with a width (see <stdint.h>) of
at least 64 bits.

The revision is expected to be approved next year.

So awk (and other) utilities that are compiled in a conforming
programming environment will get 64-bit (or wider) time_t.

However, you can expect 32-bit time_t to survive a little longer, as
implementations that currently support both 32-bit and 64-bit
programming environments will naturally continue to support both, and
they may well decide to declare that only the 64-bit environment
conforms to POSIX rather than making time_t 64-bit in the 32-bit
environment.

On the other hand, implementations that *only* support 32-bit time_t
will have to change in order to conform.

--
Geoff Clare <netnews@gclare.org.uk>

Re: Y2K38 bug (January 19, 2038)

<4n45N.160127$OPFb.27477@usenetxs.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1746&group=comp.lang.awk#1746

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx15.ams4.POSTED!not-for-mail
From: zgedneil@spam^H^H^H^Hgmail.com (Russell Marks)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
Organization: this space intentionally left blank
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
Lines: 12
Message-ID: <4n45N.160127$OPFb.27477@usenetxs.com>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Wed, 15 Nov 2023 14:14:24 UTC
Date: Wed, 15 Nov 2023 14:14:24 GMT
X-Received-Bytes: 1151
 by: Russell Marks - Wed, 15 Nov 2023 14:14 UTC

J Naman <jnaman2@gmail.com> wrote:

> Is there any plan or schedule for POSIX to replace the Unix 32-bit
> time [...] I am really asking if GNU awk or other awks expect to
> upgrade before or after the next revision of POSIX in 2026? [...]
> I keep running into Y2K38 issues with some US government data.

If you use GNU awk on a *recent* Linux or *BSD, it should work
already. "gawk 'BEGIN{print strftime("%Y",1e10)}'" on Debian Bookworm
gives 2286, for example.

-Rus.

Re: Y2K38 bug (January 19, 2038)

<874jdgwlhh.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1891&group=comp.lang.awk#1891

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Fri, 08 Mar 2024 11:51:22 -0800
Organization: None to speak of
Lines: 39
Message-ID: <874jdgwlhh.fsf@nosuchdomain.example.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="ba4161de3c6afa3b79edb2bdfdc78ddd";
logging-data="1988141"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pVxotybyw53WgrYlpBNQV"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:paw8fYA+hTcUnaaAPsq+SPqVLm0=
sha1:hxfBJobPdZEZF8Lxemwivvg6+9A=
 by: Keith Thompson - Fri, 8 Mar 2024 19:51 UTC

Geoff Clare <geoff@clare.See-My-Signature.invalid> writes:
> J Naman wrote:
>> Is there any plan or schedule for POSIX to replace the Unix 32-bit
>> time by a 64-bit time format to avoid the Y2K38 bug ( January 19,
>> 2038, at 03:14:07 UTC.)? I am really asking if GNU awk or other awks
>> expect to upgrade before or after the next revision of POSIX in 2026?
>> Is there any certainty that POSIX WILL revise time in 2026? keep
>> running into Y2K38 issues with some US government data. mktime() is
>> no big deal to handle at the user level, but strftime() IS a (the)
>> real problem.
>
> The current draft of the next POSIX revision has this in the
> description of the <sys/types.h> header:
>
> time_t shall be an integer type with a width (see <stdint.h>) of
> at least 64 bits.
>
> The revision is expected to be approved next year.
[...]

Do you have a link to that draft?

Current POSIX says that time_t is an integer type, and time() returns
the number of seconds since the Epoch, 1970-01-01 00:00:00 UTC. All
this is more stringent than the ISO C requirements.

So a POSIX-conforming implementation can already use a 64-bit time_t,
and many do so. What's apparently changing in the next revision is that
time_t is *required* to be at least 64 bits.

I'm a little disappointed that POSIX doesn't require time_t to be
signed. 64 bits is enough to represent a range of about 584 billion
years. An unsigned time_t makes it impossible to represent times before
1970.

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

Re: Y2K38 bug (January 19, 2038)

<usfre1$293dh$1@news.xmission.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1892&group=comp.lang.awk#1892

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Fri, 8 Mar 2024 20:11:45 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <usfre1$293dh$1@news.xmission.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
Injection-Date: Fri, 8 Mar 2024 20:11:45 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2395569"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 8 Mar 2024 20:11 UTC

In article <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>,
J Naman <jnaman2@gmail.com> wrote:
>Is there any plan or schedule for POSIX to replace the Unix 32-bit time by a
>64-bit time format to avoid the Y2K38 bug ( January 19, 2038, at 03:14:07 UTC.)?
>I am really asking if GNU awk or other awks expect to upgrade before or after the
>next revision of POSIX in 2026? Is there any certainty that POSIX WILL revise
>time in 2026?
>I keep running into Y2K38 issues with some US government data. mktime() is no big
>deal to handle at the user level, but strftime() IS a (the) real problem.

This is a non-issue in GAWK. Note that AWK in general does not have an
integer type. It just has a "number" type - and that type is a C double.

Observe:

% gawk 'BEGIN { print strftime("%c",1e12)}'
Thu Sep 26 19:46:40 33658
%

So, I think we're good.

--
It's possible that leasing office space to a Starbucks is a greater liability
in today's GOP than is hitting your mother on the head with a hammer.

Re: Y2K38 bug (January 19, 2038)

<usmq73$3j5ib$2@toylet.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1903&group=comp.lang.awk#1903

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!toylet.eternal-september.org!.POSTED!not-for-mail
From: toylet.toylet@gmail.com (Mr. Man-wai Chang)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Mon, 11 Mar 2024 19:33:54 +0800
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <usmq73$3j5ib$2@toylet.eternal-september.org>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<usfre1$293dh$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Mar 2024 11:33:55 -0000 (UTC)
Injection-Info: toylet.eternal-september.org; posting-host="e10f395b0563ffe3f32c382f0dc3e156";
logging-data="3774027"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Nje5+MjNxC8v+Euu/kNc5"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:23AEpwRwQPLB/3Ss2xHh+PfWGSo=
In-Reply-To: <usfre1$293dh$1@news.xmission.com>
Content-Language: en-US
 by: Mr. Man-wai Chang - Mon, 11 Mar 2024 11:33 UTC

On 9/3/2024 4:11 am, Kenny McCormack wrote:
>
> This is a non-issue in GAWK. Note that AWK in general does not have an
> integer type. It just has a "number" type - and that type is a C double.
>
> Observe:
>
> % gawk 'BEGIN { print strftime("%c",1e12)}'
> Thu Sep 26 19:46:40 33658
> %
>
> So, I think we're good.

Well, you can always outsource the job using system()! :)

Year 2038 problem is not just a software issue. You also need 64-bit CPU
to compute dates. Awk is just a tool that makes use of operating systems.

Year 2038 problem - Wikipedia
<https://en.wikipedia.org/wiki/Year_2038_problem>

Re: Y2K38 bug (January 19, 2038)

<8pd3ck-rc.ln1@ID-313840.user.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1905&group=comp.lang.awk#1905

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: geoff@clare.See-My-Signature.invalid (Geoff Clare)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Mon, 11 Mar 2024 13:32:56 +0000
Lines: 23
Message-ID: <8pd3ck-rc.ln1@ID-313840.user.individual.net>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
Reply-To: netnews@gclare.org.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net G8xJ7ggv2CkGVND8cHaiFQh20KUwvT9Do89L51BqN9+FyHDAKb
X-Orig-Path: ID-313840.user.individual.net!not-for-mail
Cancel-Lock: sha1:RnLtfuoOEnojsXyP+c8DXmfAEYE= sha256:uY2LfdekjCe8GKiPfI605cP6JzxvIf5mfwWjjeZl5iI=
User-Agent: Pan/0.154 (Izium; 517acf4)
 by: Geoff Clare - Mon, 11 Mar 2024 13:32 UTC

Keith Thompson wrote:

> Geoff Clare <geoff@clare.See-My-Signature.invalid> writes:
>>
>> The current draft of the next POSIX revision has this in the
>> description of the <sys/types.h> header:
>>
>> time_t shall be an integer type with a width (see <stdint.h>) of
>> at least 64 bits.
>>
>> The revision is expected to be approved next year.
> [...]
>
> Do you have a link to that draft?

https://www.opengroup.org/austin/login.html

Access is restricted - you need to have an account on www.opengroup.org
and be subscribed to the austin-group-l mailing list. (At least, I
think that's all you need, but ICBW.)

--
Geoff Clare <netnews@gclare.org.uk>

Re: Y2K38 bug (January 19, 2038)

<87plw0x2rk.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1906&group=comp.lang.awk#1906

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Mon, 11 Mar 2024 14:27:11 +0000
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <87plw0x2rk.fsf@bsb.me.uk>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<usfre1$293dh$1@news.xmission.com>
<usmq73$3j5ib$2@toylet.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="e2549f8e2482fd74329d4f6308b2554e";
logging-data="3849337"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Gwj71KikTNbY99VB8bTC1OkGGRHJvAKQ="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:VA6YvJqZjhL8uZHOIk6yPDr/jkE=
sha1:BJWhwOjB5FHapgjFoUf7Bby9SKY=
X-BSB-Auth: 1.08f1449ac80bf29feada.20240311142711GMT.87plw0x2rk.fsf@bsb.me.uk
 by: Ben Bacarisse - Mon, 11 Mar 2024 14:27 UTC

"Mr. Man-wai Chang" <toylet.toylet@gmail.com> writes:

> Year 2038 problem is not just a software issue. You also need 64-bit CPU to
> compute dates.

Since software can emulate 64-bt computations, it /is/ just a software
issue.

--
Ben.

Re: Y2K38 bug (January 19, 2038)

<87il1sztpb.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1908&group=comp.lang.awk#1908

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Mon, 11 Mar 2024 08:14:40 -0700
Organization: None to speak of
Lines: 31
Message-ID: <87il1sztpb.fsf@nosuchdomain.example.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<usfre1$293dh$1@news.xmission.com>
<usmq73$3j5ib$2@toylet.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="803e1d91970c7135fb6b17cffb70db2d";
logging-data="3868047"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/UN6Tok9ciPh9exEUAWFM5"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:Scnbi35LW0/Diorxat0DU8NLHEE=
sha1:5haZE7fp1bCgSOek/vDs02VQ4dU=
 by: Keith Thompson - Mon, 11 Mar 2024 15:14 UTC

"Mr. Man-wai Chang" <toylet.toylet@gmail.com> writes:
> On 9/3/2024 4:11 am, Kenny McCormack wrote:
>> This is a non-issue in GAWK. Note that AWK in general does not have
>> an
>> integer type. It just has a "number" type - and that type is a C double.
>> Observe:
>> % gawk 'BEGIN { print strftime("%c",1e12)}'
>> Thu Sep 26 19:46:40 33658
>> %
>> So, I think we're good.
>
> Well, you can always outsource the job using system()! :)
>
> Year 2038 problem is not just a software issue. You also need 64-bit
> CPU to compute dates. Awk is just a tool that makes use of operating
> systems.
>
> Year 2038 problem - Wikipedia
> <https://en.wikipedia.org/wiki/Year_2038_problem>

It is just a software issue. Awk is implemented in C. ISO C has
required 64-bit integer support since 1999.

C specifies the time() function, and does not place restrictions on
time_t or specify just how it represents times. POSIX currently does
not require 64-bit time_t, but apparently will in its next edition.

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

Re: Y2K38 bug (January 19, 2038)

<usnft0$3o4es$2@toylet.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1910&group=comp.lang.awk#1910

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!toylet.eternal-september.org!.POSTED!not-for-mail
From: toylet.toylet@gmail.com (Mr. Man-wai Chang)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 01:43:59 +0800
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <usnft0$3o4es$2@toylet.eternal-september.org>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<usfre1$293dh$1@news.xmission.com>
<usmq73$3j5ib$2@toylet.eternal-september.org> <87plw0x2rk.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Mar 2024 17:44:00 -0000 (UTC)
Injection-Info: toylet.eternal-september.org; posting-host="e10f395b0563ffe3f32c382f0dc3e156";
logging-data="3936732"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gAI3iOL5MkhFnFmgVN8DA"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:O4LJ8rXxn2FX/89xVZV7Nix58Uk=
In-Reply-To: <87plw0x2rk.fsf@bsb.me.uk>
Content-Language: en-US
 by: Mr. Man-wai Chang - Mon, 11 Mar 2024 17:43 UTC

On 11/3/2024 10:27 pm, Ben Bacarisse wrote:
>
> Since software can emulate 64-bt computations, it /is/ just a software
> issue.

This is the part I don't quite understand. I remember the Y2K problem,
but I was dealing with Foxpro for DOS not C.

Re: Y2K38 bug (January 19, 2038)

<usng5u$3o4es$3@toylet.eternal-september.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1911&group=comp.lang.awk#1911

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!toylet.eternal-september.org!.POSTED!not-for-mail
From: toylet.toylet@gmail.com (Mr. Man-wai Chang)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 01:48:45 +0800
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <usng5u$3o4es$3@toylet.eternal-september.org>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 11 Mar 2024 17:48:47 -0000 (UTC)
Injection-Info: toylet.eternal-september.org; posting-host="e10f395b0563ffe3f32c382f0dc3e156";
logging-data="3936732"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19D48zAIxRR4oScYY0itXoN"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:e5K7Zu4Fle/E0sFa49t2KP5UuFo=
In-Reply-To: <874jdgwlhh.fsf@nosuchdomain.example.com>
Content-Language: en-US
 by: Mr. Man-wai Chang - Mon, 11 Mar 2024 17:48 UTC

On 9/3/2024 3:51 am, Keith Thompson wrote:
>
> I'm a little disappointed that POSIX doesn't require time_t to be
> signed. 64 bits is enough to represent a range of about 584 billion
> years. An unsigned time_t makes it impossible to represent times before
> 1970.

Could we roll our own signed time_t? :)

Re: Y2K38 bug (January 19, 2038)

<87edcga9yu.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1912&group=comp.lang.awk#1912

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Mon, 11 Mar 2024 11:40:09 -0700
Organization: None to speak of
Lines: 23
Message-ID: <87edcga9yu.fsf@nosuchdomain.example.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="803e1d91970c7135fb6b17cffb70db2d";
logging-data="3955985"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BknE+LfHrxQSZXVkAQZA2"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:TwaqBjx9ZVcC4rawRkOyBzyOS6c=
sha1:TPwN+iGwguyetxCnIW3uIX2ouMI=
 by: Keith Thompson - Mon, 11 Mar 2024 18:40 UTC

"Mr. Man-wai Chang" <toylet.toylet@gmail.com> writes:
> On 9/3/2024 3:51 am, Keith Thompson wrote:
>> I'm a little disappointed that POSIX doesn't require time_t to be
>> signed. 64 bits is enough to represent a range of about 584 billion
>> years. An unsigned time_t makes it impossible to represent times before
>> 1970.
>
> Could we roll our own signed time_t? :)

I see the smiley, but I don't get the joke.

If you're creating your own implementation, you can do anything you
like. If not, and you're using an implementation that makes time_t an
unsigned type, there's not much you can do to treat it as signed. For
example, localtime() would presumably treat a time_t value of -2 as a
very large unsigned value.

I don't know of any implementations that make time_t an unsigned type.

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

Re: Y2K38 bug (January 19, 2038)

<14i0vil3a01q0k4iuu1omtmai8f9u66vvq@dim53.demon.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1915&group=comp.lang.awk#1915

  copy link   Newsgroups: comp.lang.awk
From: k.nuyt@nospam.demon.nl (Kees Nuyt)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 13:28:12 +0100
Reply-To: k.nuyt@nospam.demon.nl
Message-ID: <14i0vil3a01q0k4iuu1omtmai8f9u66vvq@dim53.demon.nl>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com> <usfre1$293dh$1@news.xmission.com> <usmq73$3j5ib$2@toylet.eternal-september.org> <87plw0x2rk.fsf@bsb.me.uk> <usnft0$3o4es$2@toylet.eternal-september.org>
User-Agent: ForteAgent/7.10.32.1214
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!193.141.40.65.MISMATCH!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 17
Injection-Date: Tue, 12 Mar 2024 13:28:13 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1422
 by: Kees Nuyt - Tue, 12 Mar 2024 12:28 UTC

On Tue, 12 Mar 2024 01:43:59 +0800, "Mr. Man-wai Chang"
<toylet.toylet@gmail.com> wrote:

>On 11/3/2024 10:27 pm, Ben Bacarisse wrote:
>>
>> Since software can emulate 64-bt computations, it /is/ just a software
>> issue.
>
> This is the part I don't quite understand.

Even a 4-bit processor can handle 64-bit integers, signed or
unsigned, just not with a single instruction.
It is just a lot of code, handling 4 bits at a time, so it will
not be fast.
--
Kees Nuyt

Re: Y2K38 bug (January 19, 2038)

<j726ck-3qt.ln1@ID-313840.user.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1916&group=comp.lang.awk#1916

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: geoff@clare.See-My-Signature.invalid (Geoff Clare)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 13:34:11 +0000
Lines: 36
Message-ID: <j726ck-3qt.ln1@ID-313840.user.individual.net>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
<87edcga9yu.fsf@nosuchdomain.example.com>
Reply-To: netnews@gclare.org.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net eWgXM9YNs47zVZXPjQxLaQNfWXmMQvEC818Gveyh8lDRZ/k2DI
X-Orig-Path: ID-313840.user.individual.net!not-for-mail
Cancel-Lock: sha1:DEP4Km14xkzNGrdYFvtD53fjzp8= sha256:PPmC0iF5ntipAf3ZtTNSiPX3s0oz95+lnkJg+hwxFN8=
User-Agent: Pan/0.154 (Izium; 517acf4)
 by: Geoff Clare - Tue, 12 Mar 2024 13:34 UTC

Keith Thompson wrote:

> "Mr. Man-wai Chang" <toylet.toylet@gmail.com> writes:
>> On 9/3/2024 3:51 am, Keith Thompson wrote:
>>> I'm a little disappointed that POSIX doesn't require time_t to be
>>> signed. 64 bits is enough to represent a range of about 584 billion
>>> years. An unsigned time_t makes it impossible to represent times before
>>> 1970.
>>
>> Could we roll our own signed time_t? :)
>
> I see the smiley, but I don't get the joke.
>
> If you're creating your own implementation, you can do anything you
> like. If not, and you're using an implementation that makes time_t an
> unsigned type, there's not much you can do to treat it as signed. For
> example, localtime() would presumably treat a time_t value of -2 as a
> very large unsigned value.
>
> I don't know of any implementations that make time_t an unsigned type.

QNX is one.

See www.qnx.net/developers/docs/6.4.0/neutrino/sys_arch/kernel.html
which says:

Valid dates on a QNX Neutrino system range from January 1970 to at
least 2038. The time_t data type is an unsigned 32-bit number, which
extends this range for many applications through 2106.

Also, having signed time_t doesn't necessarily mean that dates before
Jan 1970 are supported. I seem to recall that MS Windows has signed
time_t but does not support negative values.

--
Geoff Clare <netnews@gclare.org.uk>

Re: Y2K38 bug (January 19, 2038)

<slrnuv0qro.1gte.naddy@lorvorc.mips.inka.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1918&group=comp.lang.awk#1918

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.neodome.net!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: naddy@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 14:49:28 -0000 (UTC)
Message-ID: <slrnuv0qro.1gte.naddy@lorvorc.mips.inka.de>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
<87edcga9yu.fsf@nosuchdomain.example.com>
<j726ck-3qt.ln1@ID-313840.user.individual.net>
Injection-Date: Tue, 12 Mar 2024 14:49:28 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="50095"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Tue, 12 Mar 2024 14:49 UTC

On 2024-03-12, Geoff Clare <geoff@clare.See-My-Signature.invalid> wrote:

> Also, having signed time_t doesn't necessarily mean that dates before
> Jan 1970 are supported.

mktime(3) is documented to return (time_t)-1 in case of error, which
bodes ill for Dec 31, 1969, 23:59:59 UTC.

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: Y2K38 bug (January 19, 2038)

<87wmq76mra.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1923&group=comp.lang.awk#1923

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 16:42:01 -0700
Organization: None to speak of
Lines: 16
Message-ID: <87wmq76mra.fsf@nosuchdomain.example.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
<87edcga9yu.fsf@nosuchdomain.example.com>
<j726ck-3qt.ln1@ID-313840.user.individual.net>
<slrnuv0qro.1gte.naddy@lorvorc.mips.inka.de>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61";
logging-data="599648"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PgsPl/KnsfZfDcHdMJf7Q"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:mxmw201uwFjiEI/dL8nW6moPh88=
sha1:58nB3oiWAEn00Z+8eCLW0jczC8o=
 by: Keith Thompson - Tue, 12 Mar 2024 23:42 UTC

Christian Weisgerber <naddy@mips.inka.de> writes:
> On 2024-03-12, Geoff Clare <geoff@clare.See-My-Signature.invalid> wrote:
>> Also, having signed time_t doesn't necessarily mean that dates before
>> Jan 1970 are supported.
>
> mktime(3) is documented to return (time_t)-1 in case of error, which
> bodes ill for Dec 31, 1969, 23:59:59 UTC.

It can still return a correct value of -1. It does make it difficult
for the caller to determine whether a -1 return value denotes an error
or not.

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

Re: Y2K38 bug (January 19, 2038)

<87sf0v6mis.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1924&group=comp.lang.awk#1924

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Tue, 12 Mar 2024 16:47:07 -0700
Organization: None to speak of
Lines: 55
Message-ID: <87sf0v6mis.fsf@nosuchdomain.example.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
<87edcga9yu.fsf@nosuchdomain.example.com>
<j726ck-3qt.ln1@ID-313840.user.individual.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61";
logging-data="599648"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4/nKZjxEVPT6U4bqxhKRF"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:OWeH2v8Wo7zoVPr/dOHGCYvjuUk=
sha1:jfD0rcG+KwlgXbjnYwlYWPNdc6g=
 by: Keith Thompson - Tue, 12 Mar 2024 23:47 UTC

Geoff Clare <geoff@clare.See-My-Signature.invalid> writes:
> Keith Thompson wrote:
>> "Mr. Man-wai Chang" <toylet.toylet@gmail.com> writes:
>>> On 9/3/2024 3:51 am, Keith Thompson wrote:
>>>> I'm a little disappointed that POSIX doesn't require time_t to be
>>>> signed. 64 bits is enough to represent a range of about 584 billion
>>>> years. An unsigned time_t makes it impossible to represent times before
>>>> 1970.
>>>
>>> Could we roll our own signed time_t? :)
>>
>> I see the smiley, but I don't get the joke.
>>
>> If you're creating your own implementation, you can do anything you
>> like. If not, and you're using an implementation that makes time_t an
>> unsigned type, there's not much you can do to treat it as signed. For
>> example, localtime() would presumably treat a time_t value of -2 as a
>> very large unsigned value.
>>
>> I don't know of any implementations that make time_t an unsigned type.
>
> QNX is one.
>
> See www.qnx.net/developers/docs/6.4.0/neutrino/sys_arch/kernel.html
> which says:
>
> Valid dates on a QNX Neutrino system range from January 1970 to at
> least 2038. The time_t data type is an unsigned 32-bit number, which
> extends this range for many applications through 2106.
>
> Also, having signed time_t doesn't necessarily mean that dates before
> Jan 1970 are supported. I seem to recall that MS Windows has signed
> time_t but does not support negative values.

Sadly, you're right.

https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64?view=msvc-170

_mktime32 returns the specified calendar time encoded as a value of
type time_t. If timeptr references a date before midnight, January
1, 1970, or if the calendar time can't be represented, _mktime32
returns -1 cast to type time_t.

I've worked on Windows code that had to deal with patients' birth dates
to determine their current age. I don't recall the exact details, but I
had to apply a 400-year offset to the birth date and current time to get
correct results for patients born before 1970. (The Gregorian calendar
repeats after 400 years.) We had 64-bit signed time_t, so it wasn't due
to this specific problem; with 32-bit time_t the 400-year offset
wouldn't have been possible.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: Y2K38 bug (January 19, 2038)

<man8ck-pdr.ln1@ID-313840.user.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1927&group=comp.lang.awk#1927

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: geoff@clare.See-My-Signature.invalid (Geoff Clare)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Wed, 13 Mar 2024 13:46:30 +0000
Lines: 30
Message-ID: <man8ck-pdr.ln1@ID-313840.user.individual.net>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
<87edcga9yu.fsf@nosuchdomain.example.com>
<j726ck-3qt.ln1@ID-313840.user.individual.net>
<slrnuv0qro.1gte.naddy@lorvorc.mips.inka.de>
<87wmq76mra.fsf@nosuchdomain.example.com>
Reply-To: netnews@gclare.org.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net IRW6VLJkBJtduP4q33cj4gCkuKbtA3ezOtwRLirKxiPxxsy2yV
X-Orig-Path: ID-313840.user.individual.net!not-for-mail
Cancel-Lock: sha1:2XSyJ7L+SeNxE6BZEZO4QSZ9qaQ= sha256:FMkUKBrOe6sV6P0B7qBmUS6NQQJ+XZm/QO/btG03DI8=
User-Agent: Pan/0.154 (Izium; 517acf4)
 by: Geoff Clare - Wed, 13 Mar 2024 13:46 UTC

Keith Thompson wrote:

> Christian Weisgerber <naddy@mips.inka.de> writes:
>> On 2024-03-12, Geoff Clare <geoff@clare.See-My-Signature.invalid> wrote:
>>> Also, having signed time_t doesn't necessarily mean that dates before
>>> Jan 1970 are supported.
>>
>> mktime(3) is documented to return (time_t)-1 in case of error, which
>> bodes ill for Dec 31, 1969, 23:59:59 UTC.
>
> It can still return a correct value of -1. It does make it difficult
> for the caller to determine whether a -1 return value denotes an error
> or not.

C23 has introduced a way to distinguish the cases. It says:

[on error] the function returns the value (time_t)(-1) and does
not change the value of the tm_wday component of the structure.

This will also be in the forthcoming POSIX.1 revision, which adds
this advice:

Since (time_t)−1 is a valid return value for a successful call to
mktime(), an application wishing to check for error situations
should set tm_wday to a value less than 0 or greater than 6 before
calling mktime(). On return, if tm_wday has not changed an error
has occurred.

--
Geoff Clare <netnews@gclare.org.uk>

Re: Y2K38 bug (January 19, 2038)

<87ttla5c2f.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1929&group=comp.lang.awk#1929

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: Y2K38 bug (January 19, 2038)
Date: Wed, 13 Mar 2024 09:30:32 -0700
Organization: None to speak of
Lines: 44
Message-ID: <87ttla5c2f.fsf@nosuchdomain.example.com>
References: <b2321bbf-e9a1-40d5-9261-db53a98a8dadn@googlegroups.com>
<o29c2k-0a9.ln1@ID-313840.user.individual.net>
<874jdgwlhh.fsf@nosuchdomain.example.com>
<usng5u$3o4es$3@toylet.eternal-september.org>
<87edcga9yu.fsf@nosuchdomain.example.com>
<j726ck-3qt.ln1@ID-313840.user.individual.net>
<slrnuv0qro.1gte.naddy@lorvorc.mips.inka.de>
<87wmq76mra.fsf@nosuchdomain.example.com>
<man8ck-pdr.ln1@ID-313840.user.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61";
logging-data="1098291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18IvlhNtLhl1ULL9Y4lgSgo"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:5YWzVIK6BeJuopXpY5LDUfxEl1Q=
sha1:AxhxK1oa30Qsa41qJmwRxQVS0GM=
 by: Keith Thompson - Wed, 13 Mar 2024 16:30 UTC

Geoff Clare <geoff@clare.See-My-Signature.invalid> writes:
> Keith Thompson wrote:
>> Christian Weisgerber <naddy@mips.inka.de> writes:
>>> On 2024-03-12, Geoff Clare <geoff@clare.See-My-Signature.invalid> wrote:
>>>> Also, having signed time_t doesn't necessarily mean that dates before
>>>> Jan 1970 are supported.
>>>
>>> mktime(3) is documented to return (time_t)-1 in case of error, which
>>> bodes ill for Dec 31, 1969, 23:59:59 UTC.
>>
>> It can still return a correct value of -1. It does make it difficult
>> for the caller to determine whether a -1 return value denotes an error
>> or not.
>
> C23 has introduced a way to distinguish the cases. It says:
>
> [on error] the function returns the value (time_t)(-1) and does
> not change the value of the tm_wday component of the structure.
>
> This will also be in the forthcoming POSIX.1 revision, which adds
> this advice:
>
> Since (time_t)−1 is a valid return value for a successful call to
> mktime(), an application wishing to check for error situations
> should set tm_wday to a value less than 0 or greater than 6 before
> calling mktime(). On return, if tm_wday has not changed an error
> has occurred.

That's likely to be the behavior for older implementations. C11 isn't
quite as explicit, but it does say:

On successful completion, the values of the tm_wday and tm_yday
components of the structure are set appropriately, and the other
components are set to represent the specified calendar time, but
with their values forced to the ranges indicated above; the final
value of tm_mday is not set until tm_mon and tm_year are determined.

I think it's reasonable to assume that tm_wday and tm_yday are not
modified unless the function is successful.

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor