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,RFC] Change __convert_from_v to use snprintf and use it


Loren James Rittle wrote:

>>....just means that a check for snprintf should be added to
>>
>>acinclude.m4/GLIBCPP_ENABLE_C99
>>
>>and the code conditionalized, like
>>
>>#if _GLIBCPP_USE_C99
>>//use snprintf
>>#else
>>//loose
>>#endif
>>
>
>FYI, snprintf() is a lot more widespread than just C99 hosts.  E.g.,
>this text was written in or before 1993 for the printf(3), et al man
>page on BSD systems:
>
>    "[...] For safety, programmers should use the snprintf() inter-
>     face instead.  Unfortunately, this interface is not portable."
>
I know that (I wrote something about this yesterday). However, from a 
practical point of view, IMHO it does'nt matter much if a function named 
"snprintf" is available. In order to implement "my" scheme (that 
suggested by glibc docs, indeed) we need exactly the C99-version, that 
returning the actual number of chars needed.

>I thought that the tao of autoconf says that we look for target
>support at a granularity finer than any particular ISO standard level.
>Grouping a bunch of stuff into GLIBCPP_ENABLE_C99 that affects QoI in
>addition to what libstdc++-v3 exposes to users via its library headers
>seems wrong to me.  However, I will not complain after observing this
>point since I can't offer to help at the moment (since I am having a
>devil of a time just finding the time required to keep my targets
>above water).
>
I see. I think that the scheme using snprintf is so much better than the 
current one that it is worth a temporary rough solution from the point 
of view of the autoconf. What about working together on the autoconf 
bits, if and when the new locale_facets code is ready and well tested?

Ciao, Paolo.



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