From bates@stat.wisc.edu  Tue Dec 16 20:26:09 1997
From: bates@stat.wisc.edu (Douglas Bates)
Date: 16 Dec 1997 14:26:09 -0600
Subject: RedHat 5.0 Linux libc to glibc
In-Reply-To: Paul Gilbert's message of Tue, 16 Dec 1997 14:21:25 -0500
References: <97Dec16.142336est.26740@mailgate.bank-banque-canada.ca>
Message-ID: <6rpvmxhw66.fsf@franz.stat.wisc.edu>

Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:

> This was posted on another list I follow and I thought it might be important if
> you are not already aware of the change:
> 
> >Between Redhat 4.2 and Redhat 5.0, Redhat changed from libc version 5 to
> >glibc version 2.0 as the standard C library. This arranges its include
> >files differently and has resulted in MOST programs needing changes to
> >compile under Redhat 5.0.

The changes between Debian GNU/Linux versions 1.3 and 2.0 are also
primarily a change from libc5 to libc6 (a.k.a. glibc 2).   R-0.60.1
compiles cleanly under either.  There is no need for changes in the
source code for R.  I would expect that the same would be true under
RedHat.

I would be very interested in contacting people who are running RedHat 
5.0 to see if the version of libc6 on RedHat still has a problem with
the ecvt system function.   I reported a bug on that several months
ago and the libc6 versions I am using still have the same bug.

Here is a C source file that exercises the bug
#include <stdio.h>
#include <stdlib.h>

void main(int argc, char **argv)
{
  int decpt, sign; char * result;
  char buf[256];
  result = ecvt((double) 1234.567, (size_t) 7, &decpt, &sign);
  printf("result is %s, decpt is %d, sign is %d\n", result, decpt, sign);
  result = ecvt((double) -987.654321, (size_t) 7, &decpt, &sign);
  printf("result is %s, decpt is %d, sign is %d\n", result, decpt, sign);
  result = ecvt((double) 0, (size_t) 7, &decpt, &sign);
  printf("result is %s, decpt is %d, sign is %d\n", result, decpt, sign);
  result = fcvt((double) 1234.567, (size_t) 7, &decpt, &sign);
  printf("result is %s, decpt is %d, sign is %d\n", result, decpt, sign);
  result = fcvt((double) -987.654321, (size_t) 7, &decpt, &sign);
  printf("result is %s, decpt is %d, sign is %d\n", result, decpt, sign);
  result = fcvt((double) 0, (size_t) 7, &decpt, &sign);
  printf("result is %s, decpt is %d, sign is %d\n", result, decpt, sign);
  result = gcvt((double) 1234.567, (size_t) 7, buf);
  printf("result of gcvt is %s\n", result);
  result = gcvt((double) -987.654321, (size_t) 7, buf);
  printf("result of gcvt is %s\n", result);
  result = gcvt((double) 0, (size_t) 7, buf);
  printf("result of gcvt is %s\n", result);
}

When compiled and run it produces obviously incorrect results.
result is 11234.567, decpt is 4, sign is 0
result is 9987.6543, decpt is 3, sign is 1
result is 00.000000, decpt is 1, sign is 0
result is 11234.567000, decpt is 4, sign is 0
result is 9987.654321, decpt is 3, sign is 1
result is 00.000000, decpt is 1, sign is 0
result of gcvt is 1234.567
result of gcvt is -987.6543
result of gcvt is 0

For one thing the string returned as the result should not contain a
decimal point.  Is someone is running RedHat 5.0 could you check the
results on there?
-- 
Douglas Bates                            bates@stat.wisc.edu
Statistics Department                    608/262-2598
University of Wisconsin - Madison        http://www.stat.wisc.edu/~bates/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


RedHat 5.0 Linux libc to glibc
Douglas Bates