Mailing List Archive

svn commit: r1915593 - /perl/modperl/trunk/src/modules/perl/modperl_common_util.c
Author: jorton
Date: Tue Feb 6 08:33:52 2024
New Revision: 1915593

URL: http://svn.apache.org/viewvc?rev=1915593&view=rev
Log:
* src/modules/perl/modperl_common_util.c (modperl_table_magic_copy):
Use I32 rather than int for 'namelen' argument, fixing an
incompatible function pointer error/warning in a 32-bit build:

modperl_common_util.c:57:53: error: initialization of ‘int (*)(PerlInterpreter *, SV *, MAGIC *, SV *, const char *, I32)’ {aka ‘int (*)(struct interpreter *, struct sv *, struct magic *, struct sv *, const char *, long int)’} from incompatible pointer type ‘int (*)(PerlInterpreter *, SV *, MAGIC *, SV *, const char *, int)’ {aka ‘int (*)(struct interpreter *, struct sv *, struct magic *, struct sv *, const char *, int)’} [-Wincompatible-pointer-types]
57 | modperl_table_magic_copy};
| ^~~~~~~~~~~~~~~~~~~~~~~~

Checked back to Perl 5.14.x which has I32 (a typedef of long int on
i686) rather than int in the prototype for the svt_copy function
pointer in MGVTBL, so I32 appears to have been always correct here:

int (*svt_copy)(SV *sv, MAGIC* mg, SV *nsv, const char *name, I32 namlen);

per https://perldoc.perl.org/5.14.0/perlguts

Modified:
perl/modperl/trunk/src/modules/perl/modperl_common_util.c

Modified: perl/modperl/trunk/src/modules/perl/modperl_common_util.c
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_common_util.c?rev=1915593&r1=1915592&r2=1915593&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_common_util.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_common_util.c Tue Feb 6 08:33:52 2024
@@ -41,7 +41,7 @@

MP_INLINE static
int modperl_table_magic_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv,
- const char *name, int namelen)
+ const char *name, I32 namelen)
{
/* prefetch the value whenever we're iterating over the keys */
MAGIC *tie_magic = mg_find(nsv, PERL_MAGIC_tiedelem);