Index | Thread | Search

From:
"Theo de Raadt" <deraadt@openbsd.org>
Subject:
Re: drop a useless function
To:
Philipp Klaus Krause <pkk@spth.de>
Cc:
tech@openbsd.org
Date:
Tue, 08 Apr 2025 10:30:58 -0600

Download raw body.

Thread
Philipp Klaus Krause <pkk@spth.de> wrote:

> Am 07.04.25 um 21:20 schrieb Jan Stary:
> > @@ -358,7 +357,7 @@ show(char *zone, time_t t, int v)
> >   	if (v) {
> >   		tmp = gmtime(&t);
> >   		if (tmp == NULL) {
> > -			printf(tformat(), t);
> > +			printf("%lld", t);
> 
> This assumes that time_t will always be the same as long long int. I
> guess it is reasonable to assume that time_t will have at least 64 bits
> for the foreseeable future. But is there a risk of long long becoming
> wider than time_t for some platforms? If yes, I'd recommend to cast to a
> suitable type, e.g.:
> 
> printf(PRIdLEAST64, (int_least64_t)t);

Throughout the tree we use "%lld" to print a time_t.  Years ago, we did
all of this userland work in a week or two.  It was undramatic, and easy.

We don't use PRIdLEAST64 _ANYWHERE_

In preparing for a time after you are dead, which is very much overthinking it.

PRI* is disgusting, and we've seen no need for it anywhere in base.