summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2022-06-22 14:27:11 +1000
committerTony Cook <tony@develop-help.com>2022-07-18 11:22:08 +1000
commita8b89476b094f419cd7760635158726263e84631 (patch)
tree154bf515c5fabbdbb886b7a353e3d57cf028a4b9 /sv.h
parentbda3b19c10a9003a3e7c8c91f6674d892bcc2100 (diff)
downloadperl-a8b89476b094f419cd7760635158726263e84631.tar.gz
replace (0+(pointer)) with casts to the pointer type
Old versions (3.3.6) of gcc allowed assignment to such casts, but this is no longer an issue.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sv.h b/sv.h
index 1eecc31403..d4d5681541 100644
--- a/sv.h
+++ b/sv.h
@@ -1398,8 +1398,8 @@ object type. Exposed to perl code via Internals::SvREADONLY().
#ifndef PERL_POISON
/* Given that these two are new, there can't be any existing code using them
* as LVALUEs, so prevent that from happening */
-# define SvPVX_mutable(sv) (0 + (sv)->sv_u.svu_pv)
-# define SvPVX_const(sv) ((const char*)(0 + (sv)->sv_u.svu_pv))
+# define SvPVX_mutable(sv) ((char *)((sv)->sv_u.svu_pv))
+# define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
#else
/* Except for the poison code, which uses & to scribble over the pointer after
free() is called. */