This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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] Use __snprintf when available


>> 2- Autoconf issues, which seem to me really of two different kinds:
>> 
>>     * Are there any actual systems which make available a C99-conforming
>>     snprintf but which do not pass the tests for _GLIBCPP_USE_C99 enabled?
>>     I think Loren in principle is interested in supporting them.
>
>I think HP-UX 11.0 (IA64 and PA) fits this situation.

Hummm. Honestly I disagree.

>There is an
>snprintf on the system but during config (of the library) I see:
>
>checking for ISO C99 support in <math.h>... no
>checking for ISO C99 support in <stdio.h>... yes
>checking for ISO C99 support in <stdlib.h>... no
>checking for additional ISO C99 support in <wchar.h>... no
>checking for enabled ISO C99 support... no
>checking for ISO C99 wchar_t support... no
>
>I also ran a quick experiment and verified that if the buffer is too
>small that snprintf returns -1.  Am I correct in thinking that this is
>not c99 conformant?

Yes, you are correct, and that's why I disagree with the point you made above! In fact, my first issue is about systems which, while not being fully C99-conformant, OTOH have a /conformant/ snprintf. It would be nice to enable for them too the nicer staging code which went in yesterday, but currently it is disabled, depending on the check for full C99 conformance.

Notice, that having available a snprintf returning -1 in case of error is not useful, since in the first step of the scheme suggested in the glibc docs (which we have implemented) we /need/ to know the actual number of chars necessary for the printtf and only a C99-conformant snprintf returns it in any case.

Ciao, Paolo.



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