severity 482139 minor
thanks

On Wed, May 21, 2008 at 12:59:50AM +0200, Sebastian Harl wrote:
> Package: perl
> Version: 5.10.0-10
> Severity: normal
 
> While testing a release candidate of rrdtool 1.3, which uses a quite
> long version number (1.299908051800), I stumped across the following
> error message:
> 
>   RRDs object version 1.2999080518 does not match bootstrap parameter
>   1.299908052 at /usr/lib/perl/5.10/DynaLoader.pm line 219.
> 
> Obviously, the macro XS_VERSION_BOOTCHECK (defined in XSUB.h) treats the
> object version differently from the bootstrap parameter in regard to
> precision.

It works if $VERSION is quoted in RRDs.pm:

-$VERSION=1.299907080300;
+$VERSION="1.299907080300";

The difference is in Perl_upg_version(), called via Perl_new_version()
from the XS_VERSION_BOOTCHECK macro. Perl_upg_version() converts a
double value (NV) to a string with nine decimals while leaving a string
value intact.

This seems to be a documentation problem or at most a real bug with an
easy workaround, so lowering the severity.

Assuming the behaviour is intentional and just needs documentation,
it's a bit hard to say where that should go. DynaLoader doesn't actually
know anything about the version comparison - the boot_<module> function
containing the XS_VERSION_BOOTCHECK call is generated by ExtUtils::ParseXS
via xsubpp.

The attached patch adds a note about this in perlxs.pod, in the
'VERSIONCHECK' context. I'll send this upstream.

Cheers,
-- 
Niko Tyni   [email protected]
diff --git a/pod/perlxs.pod b/pod/perlxs.pod
index c367f4c..a6e21a3 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

Reply via email to