From: Quasar Newsgroups: comp.os.msdos.djgpp Subject: Re: Alternative to fcvt for older DJGPP? Date: 05 Aug 2003 20:14:32 GMT Organization: Concentric Internet Services Lines: 21 Message-ID: References: <76uzeozd7s3g.1sgoajp58hmqa$.dlg AT 40tude DOT net> <1sb2cgsjrn9c1.1qat04crl2pqh$.dlg AT 40tude DOT net> <15oavr9z6uf0m$.1l1oz07obzrud DOT dlg AT 40tude DOT net> NNTP-Posting-Host: 66.238.153.147 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit User-Agent: 40tude_Dialog/2.0.3.1 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On 4 Aug 2003 15:31:31 GMT, Hans-Bernhard Broeker wrote: > If you need snprintf(), but there is none in the platform's libc that > you can use, you're toast. Period. This is of course the actual > reason why snprintf() was added to C99 in the first place. > > Only a compiler implementor (in this case: the DJGPP team) can write a > complete and efficient implementation of snprintf(). User code > generally can't. Floating point stuff is the main obstacle here, but > integers can be surprisingly hairy to get right, too. Aside from the use of fcvt in one place, the rest of the code is pure ANSI C. It's probably not as efficient as some libc implementations, but it may be more efficient than some others, according to what I read on the guy's site where I picked it up. Also, it's not just the presence of the function that concerns me, but its behavior. Some compilers have s(n)printf's that are buggy or not really standard compliant. Using one implementation on all the platforms I target guarantees the same behavior everywhere. I consider that a very valuable feature. James