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
On Feb 24 21:24, Corinna Vinschen wrote:
> On Feb 24 15:00, Howland Craig D (Craig) wrote:
> > 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.)
>
> IIUC the _POSIX_C_SOURCE macro is a feature test macro to be used by
> *applications* to enable or disable certain interfaces and definitions
> in the header files. It is not supposed to be used in the C library
> itself to switch features on and off.
>
> Consider what that means for the library. If all POSIX functionality is
> switched on and off by a single macro, then all these features are
> switched on and off for a target. There's no way to define certain
> functionality for inclusion into a build on a per-target base anymore.
> I'm not so sure this would be feasible.
Having said that, using the _POSIX_C_SOURCE macro in the header files
makes of course sense.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat