From berw|n@tur|@ch @end|ng |rom gm@||@com  Thu Oct  6 10:41:46 2022
From: berw|n@tur|@ch @end|ng |rom gm@||@com (Berwin A Turlach)
Date: Thu, 6 Oct 2022 16:41:46 +0800
Subject: [Rd] A potential POSIXlt->Date bug introduced in r-devel
In-Reply-To: <25406.36513.13316.676488@stat.math.ethz.ch>
References: <CABzLhzzsnRCwM3LPM-z2T8YFO3bBcD7=iE3Hxx9rLdEUeAkk3g@mail.gmail.com>
 <25406.36513.13316.676488@stat.math.ethz.ch>
Message-ID: <20221006164146.39f9b8e4@ECM-DTC-716.uniwa.uwa.edu.au>

G'day all,

On Thu, 6 Oct 2022 10:15:29 +0200
Martin Maechler <maechler at stat.math.ethz.ch> wrote:

> >>>>> Davis Vaughan 
> >>>>>     on Wed, 5 Oct 2022 17:04:11 -0400 writes:  

>     > # Weird, where is the `NA`?
>     > as.Date(x)  
>     > #> [1] "2013-01-31" "1970-01-01" "2013-03-31"  
>     > ```  
> 
> I agree that the above is wrong, i.e., a bug in current  R-devel.

I have no intention of hijacking this thread, but I wonder whether this
is a good opportunity to mention that the 32 bit build of R-devel falls
over on my machine since 25 September.  It fails one of the regression
tests in reg-tests-1d.R.  The final lines of reg-tests-1d.Rout.fail
are:

> tools::Rd2txt(rd, out <- textConnection(NULL, "w"), fragment = TRUE)
> stopifnot(any(as.character(rd) != "\n"),
+           identical(textConnectionValue(out)[2L], "LaTeX"));
close(out)
> ## empty output in R <= 4.2.x
> 
> 
> ## as.POSIXlt(<very large Date>)  gave integer overflow
> stopifnot(as.POSIXlt(.Date(2^31 + 10))$year == 5879680L)
Error: as.POSIXlt(.Date(2^31 + 10))$year == 5879680L is not TRUE
Execution halted


I should have reported this earlier, but somehow did not find the time
to do so.  So I thought I mention it here. :)

Cheers,

	Berwin



[Rd] A potential POSIXlt->Date bug introduced in r-devel
Berwin A Turlach