This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFA] strftime: Add POSIX flags, width, and handling for E and O modifier


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]