This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH,RFC] Change __convert_from_v to use snprintf and use it
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Tue, 19 Mar 2002 00:19:29 +0100
- Subject: Re: [PATCH,RFC] Change __convert_from_v to use snprintf and use it
- References: <Pine.SOL.3.91.1020318150316.20216A-100000@taarna.cygnus.com>
Benjamin Kosnik wrote:
> > Please let me know what do you think of it, if perhaps may be only viable for the head,
> > being to invasive. Tested i686-pc-linux-gnu.
>
> I think the changed signature of __convert_from_v should be checked in,
> even if nothing is done with it at the moment.
Thanks. I will do.
> Also, the testsuite entries.
Those are now in as part of the bottomline fix for money_put::do_put overflows.
> Furthermore,
>
> > I have just learned :-( that snprintf is only part of C99, not of C89,
> > despite being quite widespread. Therefore, we cannot assume it to be
> > available on systems using glibc2.0.x or whatever not C99 compliant.
>
> ....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
Thanks once more. I admit to be very ignorant about those matters. I'm indeed /very/ happy
to know that snprintf can be used when available (in the form standardized as part of C99,
indeed!)
Just to be reassure myself to understand what you mean: is it ok if what you call //loose
takes in fact 20-30 lines of code, not just a 2-3??
In that case, I'm very happy to work on this in the next few days! The management of the
staging buffers is /so/ nice with snprintf!
Ciao, Paolo.