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: [PATCH] Support %m in printf functions


On 01/03/2012 11:33 AM, Eric Blake wrote:
>On 01/03/2012 03:37 AM, Richard Earnshaw wrote:
>> On 01/01/12 17:59, Yaakov (Cygwin/X) wrote:
>>> This patch adds support for the "%m" conversion specifier in the
printf
>>> and wprintf functions, a GNU extension:
>>
>> I think there should be a way of building printf with all GNU
extensions
>> disabled.
>
>I very much agree that this needs to be gated if we add it; I also
think
>that none of the existing gates are appropriate (I see at least these
>existing gates _NO_POS_ARGS, _NO_LONGLONG, FLOATING_POINT, _NO_LONGDBL,
>_MB_CAPABLE and _WANT_IO_C99_FORMATS), se we'd need a new one, as well
>as the configure machinery to enable the gate.
>
>Also, I note that right now we have %'d under _WANT_IO_C99_FORMATS,
>which isn't really accurate, as support for the thousands separator is
a
>POSIX but not a C99 requirement.  _WANT_IO_C99_FORMATS for things like
>%hhd is appropriate, though, as that really was something added in C99
>but not in C89.  So as long as we are talking about adding gates, maybe
>we should add two levels of gates: one for things required by POSIX but
>not C99, and one for extensions like %m that are not required by POSIX.
>
I agree that the present gates are somewhat sloppy and that cleaning up
and augmenting them is a good idea.

I suggest that GLIBC extensions are worthy of their own gating category.
(GLIBC uses _GNU_SOURCE to enable their own extensions, but they couple
this with all other addition categories (e.g. POSIX, BSD), so this is
not good for Newlib's purposes.  I'd suggest something like
_GLIBC_EXTENSION.)

Craig 


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