This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: [RFA] strftime: Add POSIX flags, width, and handling for E and O modifier
- From: "Howland Craig D (Craig)" <howland at LGSInnovations dot com>
- To: "Newlib" <newlib at sourceware dot org>
- Cc: "Jeff Johnston" <jjohnstn at redhat dot com>
- Date: Wed, 24 Feb 2010 15:00:35 -0500
- Subject: RE: [RFA] strftime: Add POSIX flags, width, and handling for E and O modifier
- References: <20100222135945.GV5683@calimero.vinschen.de> <4B857B4B.4010503@redhat.com>
The E and O modifiers are C99, also (not just POSIX extensions).
So if that were to be gated, it would want to be something like
#if defined(USE_LOCALE)
The '0' and '+' padding flags are POSIX CX extensions, and I think
want _POSIX_C_SOURCE as the gate. (Which is allowed to be not defined
if _XOPEN_SOURCE is, which we'd want to cover in a header somewhere,
as the code may define _POSIX_C_SOURCE if is is not defined yet
_XOPEN_SOURCE has been). So
#if defined(_POSIX_C_SOURCE)
for the '0' and '+' flags. Although it might be better to say something
like:
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L
(Or another appropriate number. See the
http://sourceware.org/ml/newlib/2010/msg00159.html thread.)
Craig
-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org]
On Behalf Of Jeff Johnston
Sent: Wednesday, February 24, 2010 2:18 PM
To: newlib@sourceware.org
Subject: Re: [RFA] strftime: Add POSIX flags, width, and handling for E
and O modifier
On 22/02/10 08:59 AM, Corinna Vinschen wrote:
> Hi,
>
> below is a rather big patch to libc/time/strftime.c. It reworks
> strftime and wcsftime to accomplish the following:
>
> - Add the POSIX-1.2008 '0' and '+' padding flags
>
...
> Ok to apply?
>
Yes. If you can cordone off major functional sections using a flag to
save space for cross-platforms that are ok with current functionality:
e.g. #ifdef __POSIX_2008_STRFTIME__, that would be helpful.
-- Jeff J.