Index | Thread | Search

From:
Todd C. Miller <millert@openbsd.org>
Subject:
Re: time.h: const correct tm_zone
To:
Theo Buehler <tb@theobuehler.org>
Cc:
tech@openbsd.org
Date:
Wed, 19 Nov 2025 16:31:41 -0700

Download raw body.

Thread
On Tue, 18 Nov 2025 09:32:21 +0100, Theo Buehler wrote:

> POSIX.1-2024 standardized struct tm's tm_zone as a const char *:
> https://austingroupbugs.net/view.php?id=1533
>
> Avoid casting away const and fix some warnings introduced in
> strptime.c r1.32 when moving gmt[] and utc[] to rodata:
>
> /usr/src/lib/libc/time/strptime.c:423:17: warning: assigning to 'char *' from
>  'const char[4]' discards qualifiers [-Wincompatible-pointer-types-discards-q
> ualifiers]
>   423 |                                 tm->tm_zone = gmt;
>       |                                             ^ ~~~
>
> This diff went through an amd64 bulk with no fallout.

OK millert@

 - todd