bug-gnulib
[Top][All Lists]
Advanced

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

Re: Changes in nl_langinfo() and strftime() API in glibc


From: Bruno Haible
Subject: Re: Changes in nl_langinfo() and strftime() API in glibc
Date: Thu, 25 Jan 2018 09:04:42 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-104-generic; KDE/5.18.0; x86_64; ; )

Hi Rafal,

> I can't see _NL_ABALTMON_* here. Isn't it necessary?

Given the name of these constants (they start with an underscore),
it appears that they are not proposed for standardization. So,
as far as I understand, the primary way to use the abbreviated
alternate month names is through nstrftime %Ob, not through nl_langinfo.

I hope (haven't checked) that Paul's changes to nstrftime.c will,
on platforms that don't support strftime %Ob, fall back to strftime %b.

> > +The constants @code{ALTMON_1} to @code{ALTMON_12} are not defined on some
> > +platforms:
> > +glibc 2.26 and many others.
> > address@hidden
> 
> To be more precise: we are adding ALTMON_1 since glibc 2.27 (as GNU
> extension) so it is not defined on glibc 2.26 and older.

Yup, that's what I understood from the glibc commit history.

> (This is to avoid confusion: glibc 2.26 and newer? just glibc 2.26?)

That's the style we use in the gnulib manual. When something is broken
in SW version x, the reader can't assume that it works in SW versions < x.
And we try to list the highest version in which it is broken (although
often we don't know precisely).

> Although I don't
> understand why "case MON_*" has been removed and added. Formatting
> changes maybe?

I added a level of braces. This required reindentation.

> > + case ALTMON_1:
> > + case ALTMON_2:
> > + case ALTMON_3:
> > + case ALTMON_4:
> > + case ALTMON_5:
> > + case ALTMON_6:
> > + case ALTMON_7:
> > + case ALTMON_8:
> > + case ALTMON_9:
> > + case ALTMON_10:
> > + case ALTMON_11:
> > + case ALTMON_12:
> > + tmm.tm_mon = item - ALTMON_1;
> > + /* The platforms without nl_langinfo() don't support strftime with %OB.
> > + We don't even need to try. */
> > + #if 0
> > + if (!strftime (nlbuf, sizeof nlbuf, "%OB", &tmm))
> > + #endif
> 
> Not really, I think that this removed implementation would be useful
> sometimes.

No, this code is meant for the platforms Minix, mingw, MSVC, BeOS.
mingw and MSVC don't support strftime with %OB; I checked the documentation.
And for Minix and BeOS I can tell it without even checking the documentation.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]