Skip to content

Commit 9f1f50d

Browse files
committed
regen/warnings.pl: add comments about $TREE
Explain this structure, which is the input used to define all the warnings.
1 parent 2f696ff commit 9f1f50d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

regen/warnings.pl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ BEGIN
2727
sub DEFAULT_ON () { 1 }
2828
sub DEFAULT_OFF () { 2 }
2929

30+
31+
# Define the hierarchy of warnings.
32+
#
33+
# Each level in the tree is a hash which lists the names of all the
34+
# children below that level. Each child is an array consisting of the
35+
# version when that warnings category was introduced and, if a terminal
36+
# category, whether that warning is on by default; otherwise a ref to
37+
# another hash of children.
38+
#
39+
# Note that the version numbers are currently only used to sort and to
40+
# generate code comments in the output files.
41+
#
42+
# Note that warning names aren't hierarchical; by having 'pipe' as a child
43+
# of 'io', a warnings category called 'io::pipe' is NOT automatically
44+
# created. But the warnings category 'io' WILL include all the mask bits
45+
# necessary to turn on 'pipe', 'unopened' etc.
46+
3047
my $TREE = {
3148
'all' => [ 5.008, {
3249
'io' => [ 5.008, {

0 commit comments

Comments
 (0)