[RFA] strftime: Add POSIX flags, width, and handling for E and O modifier
Howland Craig D (Craig)
howland@LGSInnovations.com
Wed Feb 24 20:00:00 GMT 2010
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.
More information about the Newlib
mailing list