delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/05/03/16:07:12

Date: Sat, 03 May 2003 22:10:36 +0300
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: rich AT phekda DOT freeserve DOT co DOT uk
Message-Id: <1190-Sat03May2003221035+0300-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3EB39994.5B197777@phekda.freeserve.co.uk> (message from Richard
Dawe on Sat, 03 May 2003 11:27:32 +0100)
Subject: Re: gcvt and leading zeroes
References: <3EB39994 DOT 5B197777 AT phekda DOT freeserve DOT co DOT uk>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sat, 03 May 2003 11:27:32 +0100
> From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
> 
> The Perl configure script says that DJGPP's gcvt behaves unexpectedly. This is
> because it does not return a zero before the decimal point for numbers < 1.
> 
> It seems to be intentional. src/libc/compat/stdlib/gcvt.c has this code to
> remove the zero:
> 
>     /* It seems they expect us to return .XXXX instead of 0.XXXX  */
>     if (*p == '-')
>       p++;
>     if (*p == '0' && p[1] == '.')
>       memmove (p, p + 1, strlen (p + 1) + 1);
> 
> Who are "they"?

IIRC, "they" are the Cygnus test suite.  Some of the gcvt tests there
failed until I added this snippet.

Does any standard say that we _must_ produce the leading zero?  If
not, I'd argue that Perl is being gratuitously restrictive.

We could fix the Cygnus test suite, of course, if that would be a
lesser evil.  But I'd doubt that suite wants this behavior for
arbitrary reasons; probably at least newlib behaves like that.

- Raw text -


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