Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation subcategories, test deprecations properly including in perldiag and perlderprecation.pod #20916

Merged
merged 18 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
17b50ff
regcomp_internal.h - make unused macros for deprecation warnings take…
demerphq Mar 8, 2023
58736b9
utf8.c - add category parameter to unused warn_on_first_deprecated_us…
demerphq Mar 8, 2023
d1ba06b
warnings.pm - support deprecated::smartmatch category
demerphq Feb 25, 2023
e047b2b
warnings.pm - add deprecated::dot_in_inc warings category
demerphq Mar 8, 2023
9debfc2
warnings.pm - support deprecated::unicode_property_name category
demerphq Mar 8, 2023
e00cfa0
warnings.pm - add deprecated::apostrophe_as_package_separator as new …
demerphq Mar 8, 2023
21e6720
warnings.pm - add deprecated::delimiter_will_be_paired category
demerphq Mar 8, 2023
9ac796e
warnings.pm - add deprecated::goto_construct category
demerphq Mar 8, 2023
f64f6e8
warnings.pm - add deprecated::version_downgrade category
demerphq Mar 8, 2023
617170d
regen/warnings.pl - line up categories, put them in date order
demerphq Mar 8, 2023
94368e2
embed.fnc - document deprecate_xxx() macros and add them to handy.h
demerphq Mar 8, 2023
5b8881c
handy.h - fixup for deprecated warnings and docs
demerphq Mar 11, 2023
48d14d9
diag.t - detect use of "deprecate_xxx()" style functions
demerphq Mar 8, 2023
ae67d75
diag.t - parse and validate "when" parameter from deprecated_xxx() ma…
demerphq Mar 11, 2023
d2486d7
perldeprecation.pod - add smartmatch deprecation
demerphq Mar 8, 2023
ac76abe
perldeprecation.pod - apostrophe as package separator goes away in 5.42
demerphq Mar 8, 2023
229ef0a
perldeprecation.pod - add unscheduled deprecations and add category info
demerphq Mar 8, 2023
0b2570f
t/porting/deprecation.t - add tests for deprecation documentation and…
demerphq Mar 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -6212,6 +6212,7 @@ t/porting/copyright.t Check that copyright years match
t/porting/corelist.t Check that Module-CoreList has perl versions for the current perl
t/porting/customized.dat Data file for porting/customized.t
t/porting/customized.t Check all CUSTOMIZED files are as they should be
t/porting/deprecation.t Test that deprecation warnings are handled right
t/porting/diag.t Test completeness of perldiag.pod
t/porting/dual-life.t Check that dual-life bins are in utils/
t/porting/exec-bit.t Check that exec-bit bins are identified
Expand Down
11 changes: 11 additions & 0 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -3872,6 +3872,16 @@ EXpx |SV * |sv_setsv_cow |NULLOK SV *dsv \
|NN SV *ssv
#endif /* defined(PERL_ANY_COW) */
#if defined(PERL_CORE)
Cdm |void |deprecate |U32 category \
|"construct"
Cdm |void |deprecate_disappears_in \
|U32 category \
|"when" \
|"construct"
Cdm |void |deprecate_fatal_in \
|U32 category \
|"when" \
|"construct"
p |void |opslab_force_free \
|NN OPSLAB *slab
p |void |opslab_free |NN OPSLAB *slab
Expand Down Expand Up @@ -5852,6 +5862,7 @@ RS |char * |unexpected_non_continuation_text \
|const STRLEN expect_len
# if 0
S |void |warn_on_first_deprecated_use \
|U32 category \
|NN const char * const name \
|NN const char * const alternative \
|const bool use_locale \
Expand Down
2 changes: 1 addition & 1 deletion embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@
# define turkic_uc(a,b,c,d) S_turkic_uc(aTHX_ a,b,c,d)
# define unexpected_non_continuation_text(a,b,c,d) S_unexpected_non_continuation_text(aTHX_ a,b,c,d)
# if 0
# define warn_on_first_deprecated_use(a,b,c,d,e) S_warn_on_first_deprecated_use(aTHX_ a,b,c,d,e)
# define warn_on_first_deprecated_use(a,b,c,d,e,f) S_warn_on_first_deprecated_use(aTHX_ a,b,c,d,e,f)
# endif /* 0 */
# endif /* defined(PERL_IN_UTF8_C) */
# if defined(PERL_IN_UTIL_C)
Expand Down
57 changes: 46 additions & 11 deletions handy.h
Original file line number Diff line number Diff line change
Expand Up @@ -2955,18 +2955,53 @@ last-inclusive range.
#define pTHX__VALUE
#endif /* USE_ITHREADS */

/* Perl_deprecate was not part of the public API, and did not have a deprecate()
shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor
CPAN::Unpack show any users outside the core. */
/*
Perl_deprecate was not part of the public API, and did not have a deprecate()
shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor
CPAN::Unpack show any users outside the core.

=for apidoc_section $warning
=for apidoc Cdm||deprecate|U32 category|"message"
Wrapper around Perl_ck_warner_d() to produce a deprecated warning in the
given category with an appropriate message. The C<message> argument must
be a C string. The string " is deprecated" will automatically be added
to the end of the C<message>.

=for apidoc Cdm||deprecate_disappears_in|U32 category|"when"|"message"
Wrapper around Perl_ck_warner_d() to produce a deprecated warning in the
given category with an appropriate message that the construct referred
to by the message will disappear in a specific release. The C<when> and
C<message> arguments must be a C string. The C<when> string is expected
to be of the form "5.40", with no minor element in the version. The actual
message output will be the result of the following expression C<message
" is deprecated, and will disappear in Perl " when> which is why C<message>
and C<when> must be literal C strings.

=for apidoc Cdm||deprecate_fatal_in|U32 category|"when"|"message"
Wrapper around Perl_ck_warner_d() to produce a deprecated warning in the
given category with an appropriate message that the construct referred
to by the message will become fatal in a specific release. The C<when>
and C<message> arguments must be a C string. The C<when> string is expected
to be of the form "5.40", with no minor element in the version. The actual
message output will be the result of the following expression C<message " is
deprecated, and will become fatal in Perl " when> which is why C<message>
and C<when> must be literal C strings.

=cut
*/

#ifdef PERL_CORE
# define deprecate(s) Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), \
"Use of " s " is deprecated")
# define deprecate_disappears_in(when,message) \
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), \
message " is deprecated, and will disappear in Perl " when)
# define deprecate_fatal_in(when,message) \
Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), \
message " is deprecated, and will become fatal in Perl " when)
# define deprecate(category,message) \
Perl_ck_warner_d(aTHX_ packWARN(category), \
message " is deprecated")

# define deprecate_disappears_in(category,when,message) \
Perl_ck_warner_d(aTHX_ packWARN(category), \
message " is deprecated, and will disappear in Perl " when)

# define deprecate_fatal_in(category,when,message) \
Perl_ck_warner_d(aTHX_ packWARN(category), \
message " is deprecated, and will become fatal in Perl " when)
#endif

/* Internal macros to deal with gids and uids */
Expand Down
Loading