On 23 Aug 2000, Lars Gullik Bjønnes wrote: > > /* This output manipulator gives the option to use Old style format > specifications in ostreams. Note that this is done at the expense > of typesafety, so if possible this manipulator should be avoided. > When is it allowed to use this manipulator? I wrote it to be used > i18n strings and gettext, and it should only(?) be used in that > context. > > Ad. the implementation. I have only tested this on egcs-2.91.66 with > glibc 2.1.2. So further testing is needed. The loop in fmt(...) will > usually spin one or two times, but might spin more times with older > glibc libraries, since the returned -1 when size is too small. Newer > glibc returns the needed size. > One problem can be that vsnprintf is not implemented on all archs, > but AFAIK it is part of the new ANSI C standard. > > Lgb > */ > > Thanks. > > Lgb > Tested OK on two systems: a SUN Enterprise, SunOS 8 using g++ 2.8.1 and on an intel machine, RH 6.2 using egcs 2.91.66 With regard to the libc version, if calling "gnu_get_libc_version()" is the right answer, then the RH has glibc 2.1.3. As for the Solaris, ldd shows the /usr/lib/libc.so.1 present on the machine and not any GNU library. This library isn't GNU, since it doesn't have the gnu_get_libc_version() function (nm shows this). A manual search uncovered a script called glib-config, which is supposed to give the version of glib (is this the same as glibc?), and is hard-coded to echo 1.1.3. Sorry for the confusion and the delay, Lior.
Script started on Tue Sep 12 16:01:25 2000 <1|0>lior@phoenix:~/tmp/testfmt> g++ -Wall -W -o testfmt testfmt.C fmt.C <2|0>lior@phoenix:~/tmp/testfmt> ./testfmt d = 10 d = 10 <3|0>lior@phoenix:~/tmp/testfmt> exit script done on Tue Sep 12 16:01:40 2000
Script started on Tue Sep 12 16:05:38 2000 <1|0>lior@fine104:~/tmp/testfmt> g++ -Wall -W -o testfmt testfmt.C fmt.C <2|0>lior@fine104:~/tmp/testfmt> testfmt d = 10 d = 10 <3|0>lior@fine104:~/tmp/testfmt> exit Script done on Tue Sep 12 16:05:46 2000