delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/08/05/16:15:29

From: Quasar <haleyjd AT hotmail DOT com>
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: <yyimj969smay$.12tep5zbx0tj5.dlg@40tude.net>
References: <76uzeozd7s3g.1sgoajp58hmqa$.dlg AT 40tude DOT net> <u4r0y6k6x DOT fsf AT elta DOT co DOT il> <1sb2cgsjrn9c1.1qat04crl2pqh$.dlg AT 40tude DOT net> <uwudt6hc8 DOT fsf AT elta DOT co DOT il> <15oavr9z6uf0m$.1l1oz07obzrud DOT dlg AT 40tude DOT net> <bglu8j$bbs$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: 66.238.153.147
Mime-Version: 1.0
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019