| 1 | Patch-Source: https://github.com/apache/mod_perl/commit/ead5012b9f8bca08415f39e15226dbc6112a9538 |
| 2 | -- |
| 3 | From ead5012b9f8bca08415f39e15226dbc6112a9538 Mon Sep 17 00:00:00 2001 |
| 4 | From: Joe Orton <[email protected]> |
| 5 | Date: Tue, 6 Feb 2024 08:33:52 +0000 |
| 6 | Subject: [PATCH] * src/modules/perl/modperl_common_util.c |
| 7 | (modperl_table_magic_copy): Use I32 rather than int for 'namelen' argument, |
| 8 | fixing an incompatible function pointer error/warning in a 32-bit build: |
| 9 | MIME-Version: 1.0 |
| 10 | Content-Type: text/plain; charset=UTF-8 |
| 11 | Content-Transfer-Encoding: 8bit |
| 12 | |
| 13 | 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] |
| 14 | 57 | modperl_table_magic_copy}; |
| 15 | | ^~~~~~~~~~~~~~~~~~~~~~~~ |
| 16 | |
| 17 | Checked back to Perl 5.14.x which has I32 (a typedef of long int on |
| 18 | i686) rather than int in the prototype for the svt_copy function |
| 19 | pointer in MGVTBL, so I32 appears to have been always correct here: |
| 20 | |
| 21 | int (*svt_copy)(SV *sv, MAGIC* mg, SV *nsv, const char *name, I32 namlen); |
| 22 | |
| 23 | per https://perldoc.perl.org/5.14.0/perlguts |
| 24 | |
| 25 | |
| 26 | git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1915593 13f79535-47bb-0310-9956-ffa450edef68 |
| 27 | |
| 28 | src/modules/perl/modperl_common_util.c | 2 +- |
| 29 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 30 | |
| 31 | diff --git a/src/modules/perl/modperl_common_util.c b/src/modules/perl/modperl_common_util.c |
| 32 | index c5f285f9d..461750f2f 100644 |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | MP_INLINE static |
| 38 | int modperl_table_magic_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, |
| 39 | - const char *name, int namelen) |
| 40 | + const char *name, I32 namelen) |
| 41 | { |
| 42 | /* prefetch the value whenever we're iterating over the keys */ |
| 43 | MAGIC *tie_magic = mg_find(nsv, PERL_MAGIC_tiedelem); |