Skip to content

Commit

Permalink
Emit experimental::builtin warnings from the builtin function callche…
Browse files Browse the repository at this point in the history
…cker
  • Loading branch information
leonerd authored and ilmari committed Jan 24, 2022
1 parent 341f5a6 commit 9e2425b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions builtin.c
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
7 changes: 7 additions & 0 deletions pod/perldiag.pod
Expand Up @@ -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()
Expand Down

0 comments on commit 9e2425b

Please sign in to comment.