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: Paolo Carlini <pcarlini at unitus dot it>
- Cc: libstdc++ at gcc dot gnu dot org, bkoz at redhat dot com, ncm at cantrip dot org
- Date: Sun, 17 Mar 2002 19:01:54 +0100
- Subject: Re: [PATCH,RFC] Change __convert_from_v to use snprintf and use it
- References: <3C94AD6F.5FBDCE83@unitus.it>
Paolo Carlini wrote:
> Hi,
>
> I went ahead and implemented what I presented in my previous message.
>
> Indeed, it seems to me that using snprintf, allows for a /much/ cleaner allocation of the
> memory required for the various staging buffers.
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.
This is really too bad, since I think that using snprintf both greatly clean up the code and
reduces dramatically the memory used at run time when allocating the staging buffers.
I don't know if we can deal in some way with this problem, perhaps with libiberty or
whatever. Otherwise, forget about my later proposal and consider only the much more limited
fix for money_put::do_put of yesterday:
http://gcc.gnu.org/ml/libstdc++/2002-03/msg00274.html
Ciao,
Paolo.