summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <leonerd@leonerd.org.uk>2021-12-18 22:35:51 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2022-01-25 15:02:58 +0000
commitcc4aa2131ff2d87e0c3fa9bd8cf3bcfa66e245f3 (patch)
treef8a4918c97f3cb590e7d83703f7c61d2bd8d9e0c
parent59802880d7959408d0f0c8f818b71a12bba7d289 (diff)
downloadperl-cc4aa2131ff2d87e0c3fa9bd8cf3bcfa66e245f3.tar.gz
Emit experimental::builtin warnings from the builtin function callchecker
-rw-r--r--builtin.c8
-rw-r--r--pod/perldiag.pod7
2 files changed, 15 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index 1e364f34a3..22fafb87f7 100644
--- a/builtin.c
+++ b/builtin.c
@@ -50,6 +50,10 @@ static OP *ck_builtin_const(pTHX_ OP *entersubop, GV *namegv, SV *ckobj)
{
const struct BuiltinFuncDescriptor *builtin = NUM2PTR(const struct BuiltinFuncDescriptor *, SvUV(ckobj));
+ Perl_ck_warner_d(aTHX_
+ packWARN(WARN_EXPERIMENTAL__BUILTIN),
+ "Built-in function '%s' is experimental", builtin->name);
+
SV *prototype = newSVpvs("");
SAVEFREESV(prototype);
@@ -145,6 +149,10 @@ static OP *ck_builtin_func1(pTHX_ OP *entersubop, GV *namegv, SV *ckobj)
{
const struct BuiltinFuncDescriptor *builtin = NUM2PTR(const struct BuiltinFuncDescriptor *, SvUV(ckobj));
+ Perl_ck_warner_d(aTHX_
+ packWARN(WARN_EXPERIMENTAL__BUILTIN),
+ "Built-in function '%s' is experimental", builtin->name);
+
SV *prototype = newSVpvs("$");
SAVEFREESV(prototype);
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 57b55d1a59..07b1166703 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -638,6 +638,13 @@ the warning gets raised.
iterate over %ENV, it encountered a logical name or symbol definition
which was too long, so it was truncated to the string shown.
+=item Built-in function '%s' is experimental
+
+(S experimental::builtin) A call is being made to a function in the
+C<builtin::> namespace, which is currently experimental. The existence
+or nature of the function may be subject to change in a future version
+of Perl.
+
=item Callback called exit
(F) A subroutine invoked from an external package via call_sv()