From: Matthias A. <ma...@dt...> - 2004-11-12 23:54:55
|
Graham Wilson <gr...@mk...> writes: > On Wed, Nov 10, 2004 at 09:14:37PM +0100, Matthias Andree wrote: >> Graham Wilson <gr...@mk...> writes: >> > What is this and why do we need it? >> >> This is the best GPL-compatible snprintf/sscanf replacement (including >> varargs variants) that I've been able to find as a separate project. > > Why do we want it as a separate project? Ripping code out of other software is harder to track WRT updates. >> I'm not fixed on Trio, if you know something better, we can flush Trio >> and use something else, > > I would have gone with a single file implementation of snprintf instead > of using the whole Trio. I don't see why we need to add 54 files when we > could just add one. For example, mutt is known to have a good snprintf > implmentation. > > What would you think about using that? What is the claim mutt had a "good snprintf" implementation based on? It's one of the hordes of the Patrick Powell snprintf.c derivates, and as such, one that's both incomplete and pretty broken - it uses va_arg(args, short int) which is outright nonsense given the promotion rules, and it doesn't get return values right as documented. Note that the tarball only includes a small subset of the Trio files, namely these (try "make distdir" to figure): total 328K 20K CHANGES 160K trio.c 24K trionan.c 44K triostr.c 4.0K README 8.0K trio.h 4.0K trionan.h 12K triostr.h 36K regression.c 8.0K triodef.h 8.0K triop.h I'll have a look at Gary V. Vaughan's snprintfv but the tarball also is 463k in size so I'm not sure if it'll be much lighter than Trio. http://savannah.nongnu.org/projects/libsnprintfv ftp://alpha.gnu.org/gnu/snprintfv -- Matthias Andree |