Re: strftime(3) oddities with %s, %z

2022-11-02 Thread David Holland
On Wed, Nov 02, 2022 at 02:54:01PM +, Taylor R Campbell wrote: > Suppose you create a struct tm _without_ gmtime(3) or localtime(3), > using designated initializers or memset for zero-initialization, with > only what is included in POSIX: > > [...] > > This struct tm doesn't specify a t

Re: strftime(3) oddities with %s, %z

2022-11-02 Thread Mouse
>> Unless POSIX was stupid enough to mandate that all-bits-0 is nil for >> any pointer type and something well-defined for floating-point. > The former is definetely true. (Or will be.) Sad. Well, their mistake. > And i think on the TZ list it just came up it is generally true for > all "modern

Re: strftime(3) oddities with %s, %z

2022-11-02 Thread Steffen Nurpmeso
Mouse wrote in <202211021508.laa26...@stone.rodents-montreal.org>: |> Suppose you create a struct tm _without_ gmtime(3) or localtime(3), |> using designated initializers or memset for zero-initialization, with |> only what is included in POSIX: | |> struct tm tm = { |> .tm_sec = 56, |> .

Re: strftime(3) oddities with %s, %z

2022-11-02 Thread Robert Elz
Date:Wed, 2 Nov 2022 15:59:00 +0300 From:Valery Ushakov Message-ID: | I think this is the point of confusion. It's not useful to pretend | that struct tm and strftime are the proverbial spherical horses in | vacuum and argue for "a portable implementation" of

Re: strftime(3) oddities with %s, %z

2022-11-02 Thread Mouse
> Suppose you create a struct tm _without_ gmtime(3) or localtime(3), > using designated initializers or memset for zero-initialization, with > only what is included in POSIX: > struct tm tm = { > .tm_sec = 56, > .tm_min = 34, > .tm_hour = 12, > .tm_mday = 1, > .tm_mo

Re: strftime(3) oddities with %s, %z

2022-11-02 Thread Taylor R Campbell
> Date: Wed, 2 Nov 2022 15:59:00 +0300 > From: Valery Ushakov > > In other words, class tm doesn't have a public constructor that > provides a way to specify TZ info. There are other factory methods > that allow one to obtain an instance of tm that has the TZ info (in > its private parts). ...

Re: strftime(3) oddities with %s, %z

2022-11-02 Thread Valery Ushakov
On Tue, Nov 01, 2022 at 05:20:17 +0700, Robert Elz wrote: > How are you proposing that a portable implementation of strftime() > done today, before the next posix standard is released (maybe next > year, but perhaps not until 2024) would achieve what you're requesting? I think this is the point o