Fix -Wincompatible-pointer-type errors with gcc 14. ``` In file included from /usr/lib/perl5/core_perl/CORE/perl.h:6225, from RabbitMQ.xs:2: RabbitMQ.xs: In function 'XS_Net__AMQP__RabbitMQ_get_rpc_timeout': RabbitMQ.xs:1962:29: error: passing argument 2 of 'Perl_newRV_noinc' from incompatible pointer type [-Wincompatible-pointer-types] 1962 | RETVAL = newRV_noinc( output ); | ^~~~~~ | | | HV * {aka struct hv *} /usr/lib/perl5/core_perl/CORE/embed.h:423:72: note: in definition of macro 'newRV_noinc' 423 | # define newRV_noinc(a) Perl_newRV_noinc(aTHX_ a) | ^ In file included from /usr/lib/perl5/core_perl/CORE/perl.h:7870: /usr/lib/perl5/core_perl/CORE/sv_inline.h:972:34: note: expected 'SV *' {aka 'struct sv *'} but argument is of type 'HV *' {aka 'struct hv *'} 972 | Perl_newRV_noinc(pTHX_ SV *const tmpRef) | ~~~~~~~~~~^~~~~~ ``` ``` /usr/lib/perl5/core_perl/CORE/sv.h:1438:33: error: passing argument 2 of 'Perl_hv_common_key_len' from incompatible pointer type [-Wincompatible-pointer-types] 1438 | # define SvRV(sv) ((sv)->sv_u.svu_rv) /usr/lib/perl5/core_perl/CORE/embed.h:293:78: note: in definition of macro 'hv_common_key_len' 293 | # define hv_common_key_len(a,b,c,d,e,f) Perl_hv_common_key_len(aTHX_ a,b,c,d,e,f) | ^ /usr/lib/perl5/core_perl/CORE/hv.h:556:5: note: in expansion of macro 'hv_fetch' 556 | hv_fetch((hv), ASSERT_IS_LITERAL(key), (sizeof(key)-1), (lval)) | ^~~~~~~~ RabbitMQ.xs:98:31: note: in expansion of macro 'hv_fetchs' 98 | do { SV **v; if(NULL != (v = hv_fetchs(hv, #name, 0))) name = SvIV(*v); } while(0) | ^~~~~~~~~ RabbitMQ.xs:1992:7: note: in expansion of macro 'int_from_hv' 1992 | int_from_hv(SvRV(args), tv_usec); | ^~~~~~~~~~~ RabbitMQ.xs:1992:19: note: in expansion of macro 'SvRV' 1992 | int_from_hv(SvRV(args), tv_usec); | ^~~~ /usr/lib/perl5/core_perl/CORE/proto.h:1592:34: note: expected 'HV *' {aka 'struct hv *'} but argument is of type 'SV *' {aka 'struct sv *'} 1592 | Perl_hv_common_key_len(pTHX_ HV *hv, const char *key, I32 klen_i32, const int action, SV *val, const U32 hash); | ~~~~^~ ``` --- Net-AMQP-RabbitMQ-2.40012-origin/RabbitMQ.xs +++ Net-AMQP-RabbitMQ-2.40012/RabbitMQ.xs @@ -95,11 +95,11 @@ } #define int_from_hv(hv,name) \ - do { SV **v; if(NULL != (v = hv_fetchs(hv, #name, 0))) name = SvIV(*v); } while(0) + do { SV **v; if(NULL != (v = hv_fetchs((HV*)hv, #name, 0))) name = SvIV(*v); } while(0) #define double_from_hv(hv,name) \ - do { SV **v; if(NULL != (v = hv_fetchs(hv, #name, 0))) name = SvNV(*v); } while(0) + do { SV **v; if(NULL != (v = hv_fetchs((HV*)hv, #name, 0))) name = SvNV(*v); } while(0) #define str_from_hv(hv,name) \ - do { SV **v; if(NULL != (v = hv_fetchs(hv, #name, 0))) name = SvPV_nolen(*v); } while(0) + do { SV **v; if(NULL != (v = hv_fetchs((HV*)hv, #name, 0))) name = SvPV_nolen(*v); } while(0) #define has_valid_connection(conn) \ ( amqp_get_socket( conn ) != NULL && amqp_get_sockfd( conn ) > -1 ) #define assert_amqp_connected(conn) \ @@ -1959,7 +1959,7 @@ output = newHV(); hv_stores(output, "tv_sec", newSVi64( timeout_tv->tv_sec )); hv_stores(output, "tv_usec", newSVi64( timeout_tv->tv_usec )); - RETVAL = newRV_noinc( output ); + RETVAL = newRV_noinc( (SV*)output ); } OUTPUT: RETVAL