diff options
author | Niko Tyni <ntyni@debian.org> | 2009-04-29 23:02:01 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-05-02 23:32:45 +0200 |
commit | b017ed238008af06e2764e644dee23e72b0847ec (patch) | |
tree | 30dc9024903cac130c888d64f3d6940acbda6a4f | |
parent | 740bae879746875800ccc37e7777a2e842374070 (diff) | |
download | perl-b017ed238008af06e2764e644dee23e72b0847ec.tar.gz |
Document that XS_VERSION_BOOTCHECK may break if $VERSION is a long enough NV
As seen in <http://bugs.debian.org/482139>, using a long floating point
number as $VERSION can make XS_VERSION_BOOTCHECK fail because of a loss
of precision in the stringification:
RRDs object version 1.2999070803 does not match bootstrap parameter 1.29990708 at /usr/lib/perl/5.10/DynaLoader.pm line 219.
The mismatch happens in Perl_upg_version(), which converts a double value
(NV) to a string with nine decimals but leaves a string value intact.
Using a string as $VERSION works fine:
-$VERSION=1.299907080300;
+$VERSION="1.299907080300";
so recommend this in the VERSIONCHECK entry of perlxs.pod.
-rw-r--r-- | pod/perlxs.pod | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perlxs.pod b/pod/perlxs.pod index c367f4c1ca..a6e21a35ee 100644 --- a/pod/perlxs.pod +++ b/pod/perlxs.pod @@ -1211,6 +1211,12 @@ To disable version checking: VERSIONCHECK: DISABLE +Note that if the version of the PM module is an NV (a floating point +number), it will be stringified with a possible loss of precision +(currently chopping to nine decimal places) so that it may not match +the version of the XS module anymore. Quoting the $VERSION declaration +to make it a string is recommended if long version numbers are used. + =head2 The PROTOTYPES: Keyword The PROTOTYPES: keyword corresponds to B<xsubpp>'s C<-prototypes> and |