tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

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



On Tue, Oct 25, 2022 at 23:07:56 +0700, Robert Elz wrote:

> The standard is going to (as it should) say what works now, and what
> applications and users can expect.   In this case it is that
> strftime("%s") gives the same thing as printf("%ld", mktime())
> when applied to the same tm.
[...]
> There's no point lamenting minor issues like this one - struct tm (which
> might be the oldest struct type interface in unix that's still mostly
> unchanged from how it existed in the ancient past (ie: before 7th edition))
> has long passed its use by date - we really need something entirely new,
> with a whole new set of interface functions.

I'm not lamenting it.  What sent me off on that tangent was MUSL
handling of %s

  https://www.openwall.com/lists/musl/2018/01/18/4

that causes some tests to fail b/c it behaves differently then other
implementations.  As I said, I'm not familiar with the lore of this
API, so I was just seeking clarifications and venturing some
(un)educated guesses.

Thanks for your input!

-uwe


Home | Main Index | Thread Index | Old Index