|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Silence some C++ warnings with PERL_POISON
sv.c throws a few C++ cast warnings when building with PERL_PISN. I'm
not sure that patch is really useful since the testsuite currently fails when poisoning is enabled, but here it is anyway. Vincent. sv.c 2008-06-28 23:11:23.000000000 +0200 sv.c 2008-07-03 11:28:34.000000000 +0200 @@ -181,6 +181,7 @@ #ifdef PERL_PISN # define SvARENA_CHAIN(sv) ((sv)->sv_u.svu_rv) +# define SvARENA_CHAIN_set(sv,p) (SvARENA_CHAIN(sv) = (SV *) (p)) /* Whilst I'd love to do this, it seems that things like to check on unreferenced scalars # define PSIN_SV_HEAD(sv) PoisonNew(sv, 1, struct STRUCT_SV) @@ -189,6 +190,7 @@ PoisonNew(&SvREFCNT(sv), 1, U32) #else # define SvARENA_CHAIN(sv) SvANY(sv) +# define SvARENA_CHAIN_set(sv,p) (SvARENA_CHAIN(sv) = (void *) (p)) # define PSIN_SV_HEAD(sv) #endif @@ -196,7 +198,7 @@ STMT_START { \ FREE_SV_DEBUG_FILE(p); \ PSIN_SV_HEAD(p); \ - SvARENA_CHAIN(p) = (void *)PL_sv_root; \ + SvARENA_CHAIN_set(p, PL_sv_root); \ SvFLAGS(p) = SVTYPEMASK; \ PL_sv_root = (p); \ ; \ @@ -357,7 +359,7 @@ svend = &sva[SvREFCNT(sva) - 1]; sv = sva + 1; while (sv < svend) { - SvARENA_CHAIN(sv) = (void *)(SV*)(sv + 1); + SvARENA_CHAIN_set(sv, sv + 1); #ifdef DEBUGGING SvREFCNT(sv) = 0; #endif @@ -366,7 +368,7 @@ SvFLAGS(sv) = SVTYPEMASK; sv++; } - SvARENA_CHAIN(sv) = 0; + SvARENA_CHAIN_set(sv, 0); #ifdef DEBUGGING SvREFCNT(sv) = 0; #endif |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Perl > Silence some C++ warnings with PERL_POISON |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|