develooper Front page | perl.perl5.porters | Postings from February 2008

Re: Need help with threads::shared code issue

Thread Previous
From:
Rafael Garcia-Suarez
Date:
February 11, 2008 08:31
Subject:
Re: Need help with threads::shared code issue
Message ID:
b77c1dce0802110831t7de4cf9ax40df8ff722ed6ca5@mail.gmail.com
On 11/02/2008, Jerry D. Hedden <jdhedden@cpan.org> wrote:
> Change 33256 fixed the prototype for mg_copy.  In shared.xs
> (part of threads::shared), this changed the following:
>
>  int
>  sharedsv_array_mg_copy(pTHX_ SV *sv, MAGIC* mg,
> -                       SV *nsv, const char *name, int namlen)
> +                       SV *nsv, const char *name, I32 namlen)
>  {
>
> With this change, building on another version of Perl
> produces:
>
>     shared.xs:1063: warning: initialization from incompatible pointer type
>
> For 32-bit machines, this should not cause problems.
> However, I believe that if I put this change out on CPAN
> it will cause breakage on 64-bit machines.  Is this correct?

I'd say, "it depends". We're speaking about function pointers here.
On the most common platforms this shouldn't break things.

> I assume this code will eventually get propagated down to
> 5.10.x and maybe 5.8.9.  How can this change be conditionally
> incorporated in the code to work on any Perl version and on
> both 32-bit and 64-bit machines?

This patch was needed due to the change in the MGVTBL structure brought with
it. Technically this is an API change so I don't think it will be backported in
5.10.x or lower. You can safely test for PERL_VERSION >= 11.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About