Skip to content

Commit

Permalink
perl.c: Remove run time docs and redundant support for -DH
Browse files Browse the repository at this point in the history
In 2017 in fcd573e Dave Mitchell
removed support for the -DH flag but missed this.

Part of the -D options parsing is positionally sensitive, so in order to
be able to remove the 'H' option entirely I had to use a placeholder
character, and I chose '?'. This is because it is not isWORDCHAR(),
which means the preceding logic prevents it from being chosen anyway,
and thus it should be safe.
  • Loading branch information
demerphq committed Mar 5, 2022
1 parent a977878 commit b9b389c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions perl.c
Expand Up @@ -3360,7 +3360,6 @@ Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
" r Regular expression parsing and execution\n"
" x Syntax tree dump\n",
" u Tainting checks\n"
" H Hash dump -- usurps values()\n"
" X Scratchpad allocation\n"
" D Cleaning up\n"
" S Op slab allocation\n"
Expand All @@ -3384,7 +3383,13 @@ Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)

if (isALPHA(**s)) {
/* if adding extra options, remember to update DEBUG_MASK */
static const char debopts[] = "psltocPmfrxuUHXDSTRJvCAqMBLiy";
/* Note that the ? indicates an unused slot. As the code below
* indicates the position in this list is important. You cannot
* change the order or delete a character from the list without
* impacting the definitions of all the other flags in perl.h
* However because the logic is guarded by isWORDCHAR we can
* fill in holes with non-wordchar characters instead. */
static const char debopts[] = "psltocPmfrxuU?XDSTRJvCAqMBLiy";

for (; isWORDCHAR(**s); (*s)++) {
const char * const d = strchr(debopts,**s);
Expand Down

0 comments on commit b9b389c

Please sign in to comment.