From: Spider Boardman Date: Mon, 18 Mar 2002 10:09:50 +0000 (-0500) Subject: re: long double vs. Tru64 UNIX X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa17d1125252c7692b77f5cec3a606914a30cb20;p=p5sagit%2Fp5-mst-13.2.git re: long double vs. Tru64 UNIX Message-Id: <200203181509.KAA419788@leggy.zk3.dec.com> p4raw-id: //depot/perl@15293 --- diff --git a/README.tru64 b/README.tru64 index d65175a..ce2181a 100644 --- a/README.tru64 +++ b/README.tru64 @@ -48,6 +48,14 @@ You cannot Configure Perl to use long doubles unless you have at least Tru64 V5.0, the long double support simply wasn't functional before that. +At the time of this writing, there's a bug in the Tru64 libc printing +of long doubles when not using "e" notation. The values are correct +and usable, but you only get a limited number of digits displayed +unless you force the issue by using C or the like. +For Tru64 versions V5.0A through V5.1A, a patch is expected sometime after +perl 5.8.0 is released. If your libc has not yet been patched, you'll get +a warning from Configure when selecting long doubles. + =head2 64-bit Perl on Tru64 In Tru64 Perl's integers are automatically 64-bit wide, there is diff --git a/hints/dec_osf.sh b/hints/dec_osf.sh index dcaa283..b30f218 100644 --- a/hints/dec_osf.sh +++ b/hints/dec_osf.sh @@ -310,6 +310,41 @@ Cannot continue, aborting. EOF exit 1 ;; + *) + # Test whether libc's been fixed yet. + cat >try.c <<\TRY +#include +int main(int argc, char **argv) +{ + unsigned long uvmax = ~0UL; + long double ld = uvmax + 0.0L; + char buf1[30], buf2[30]; + + (void) sprintf(buf1, "%lu", uvmax); + (void) sprintf(buf2, "%.0Lf", ld); + return strcmp(buf1, buf2) != 0; +} +TRY + # Don't bother trying to work with Configure's idea of + # cc and the various flags. This might not work as-is + # with gcc -- but we're testing libc, not the compiler. + if cc -o try -std try.c && ./try + then + : ok + else + cat <<\UGLY >&4 +! +Warning! Your libc has not yet been patched so that its "%Lf" format for +printing long doubles shows all the significant digits. You will get errors +in the t/op/numconvert test because of this. (The data is still good +internally, and the "%e" format of printf() or sprintf() in perl will still +produce valid results.) See README.tru64 for additional details. + +Continuing anyway. +! +UGLY + fi + $rm -f try try.c esac ;; esac