summaryrefslogtreecommitdiff
path: root/pod/perldelta.pod
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-12-14 15:05:40 +0000
committerDavid Mitchell <davem@iabyn.com>2012-12-14 15:17:49 +0000
commit463ea2290a54ee65470ca4dd46dea0d41cfbc9dd (patch)
tree55b5470e252627f889b58a86b2bb2f29373a025f /pod/perldelta.pod
parentb7bc7afbe074add30fdf01d619e7cfef04b07403 (diff)
downloadperl-463ea2290a54ee65470ca4dd46dea0d41cfbc9dd.tar.gz
make SvUPGRADE() a statement.
To guote the perldelta entry: SvUPGRADE() is no longer an expression. Originally this macro (and its underlying function, sv_upgrade()) were documented as boolean, although in reality they always croaked on error and never returned false. In 2005 the documentation was updated to specify a void return value, but SvUPGRADE() was left always returning 1 for backwards compatibility. This has now been removed, and SvUPGRADE() is now a statement with no return value. So this is now a syntax error: if (!SvUPGRADE(sv)) { croak(...); } If you have code like that, simply replace it with SvUPGRADE(sv);
Diffstat (limited to 'pod/perldelta.pod')
-rw-r--r--pod/perldelta.pod16
1 files changed, 15 insertions, 1 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 4de94a3fc5..415facadf3 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -353,7 +353,21 @@ well.
=item *
-XXX
+SvUPGRADE() is no longer an expression. Originally this macro (and its
+underlying function, sv_upgrade()) were documented as boolean, although
+in reality they always croaked on error and never returned false. In 2005
+the documentation was updated to specify a void return value, but
+SvUPGRADE() was left always returning 1 for backwards compatibility. This
+has now been removed, and SvUPGRADE() is now a statement with no return
+value.
+
+So this is now a syntax error:
+
+ if (!SvUPGRADE(sv)) { croak(...); }
+
+If you have code like that, simply replace it with
+
+ SvUPGRADE(sv);
=back