← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Fri Aug 4 10:12:01 2017
Reported on Fri Aug 4 10:12:17 2017

Filename/usr/libdata/perl5/warnings.pm
StatementsExecuted 439 statements in 1.86ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
323231462µs462µswarnings::::importwarnings::import
211364µs399µswarnings::::register_categorieswarnings::register_categories
10108323µs323µswarnings::::unimportwarnings::unimport
42135µs35µswarnings::::_mkMaskwarnings::_mkMask
11114µs14µswarnings::::CORE:matchwarnings::CORE:match (opcode)
0000s0swarnings::::Croakerwarnings::Croaker
0000s0swarnings::::__chkwarnings::__chk
0000s0swarnings::::_bitswarnings::_bits
0000s0swarnings::::_error_locwarnings::_error_loc
0000s0swarnings::::bitswarnings::bits
0000s0swarnings::::enabledwarnings::enabled
0000s0swarnings::::fatal_enabledwarnings::fatal_enabled
0000s0swarnings::::warnwarnings::warn
0000s0swarnings::::warnifwarnings::warnif
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# -*- buffer-read-only: t -*-
2# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
3# This file is built by regen/warnings.pl.
4# Any changes made here will be lost!
5
6package warnings;
7
812µsour $VERSION = "1.36";
9
10# Verify that we're called correctly so that warnings will work.
11# Can't use Carp, since Carp uses us!
12# String regexps because constant folding = smaller optree = less memory vs regexp literal
13# see also strict.pm.
14135µs114µsdie sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2]
# spent 14µs making 1 call to warnings::CORE:match
15 if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' )
16 && __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' );
17
18172µsour %Offsets = (
19 # Warnings Categories added in Perl 5.008
20 'all' => 0,
21 'closure' => 2,
22 'deprecated' => 4,
23 'exiting' => 6,
24 'glob' => 8,
25 'io' => 10,
26 'closed' => 12,
27 'exec' => 14,
28 'layer' => 16,
29 'newline' => 18,
30 'pipe' => 20,
31 'unopened' => 22,
32 'misc' => 24,
33 'numeric' => 26,
34 'once' => 28,
35 'overflow' => 30,
36 'pack' => 32,
37 'portable' => 34,
38 'recursion' => 36,
39 'redefine' => 38,
40 'regexp' => 40,
41 'severe' => 42,
42 'debugging' => 44,
43 'inplace' => 46,
44 'internal' => 48,
45 'malloc' => 50,
46 'signal' => 52,
47 'substr' => 54,
48 'syntax' => 56,
49 'ambiguous' => 58,
50 'bareword' => 60,
51 'digit' => 62,
52 'parenthesis' => 64,
53 'precedence' => 66,
54 'printf' => 68,
55 'prototype' => 70,
56 'qw' => 72,
57 'reserved' => 74,
58 'semicolon' => 76,
59 'taint' => 78,
60 'threads' => 80,
61 'uninitialized' => 82,
62 'unpack' => 84,
63 'untie' => 86,
64 'utf8' => 88,
65 'void' => 90,
66
67 # Warnings Categories added in Perl 5.011
68 'imprecision' => 92,
69 'illegalproto' => 94,
70
71 # Warnings Categories added in Perl 5.013
72 'non_unicode' => 96,
73 'nonchar' => 98,
74 'surrogate' => 100,
75
76 # Warnings Categories added in Perl 5.017
77 'experimental' => 102,
78 'experimental::lexical_subs' => 104,
79 'experimental::regex_sets' => 106,
80 'experimental::smartmatch' => 108,
81
82 # Warnings Categories added in Perl 5.019
83 'experimental::postderef' => 110,
84 'experimental::signatures' => 112,
85 'syscalls' => 114,
86
87 # Warnings Categories added in Perl 5.021
88 'experimental::bitwise' => 116,
89 'experimental::const_attr' => 118,
90 'experimental::re_strict' => 120,
91 'experimental::refaliasing' => 122,
92 'experimental::win32_perlio' => 124,
93 'locale' => 126,
94 'missing' => 128,
95 'redundant' => 130,
96);
97
98193µsour %Bits = (
99 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x05", # [0..65]
100 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29]
101 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30]
102 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
103 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
104 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
105 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
106 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
107 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
108 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
109 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x51\x15\x00", # [51..56,58..62]
110 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [58]
111 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [59]
112 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [52]
113 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [55]
114 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [60]
115 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [61]
116 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [53]
117 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [56]
118 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [54]
119 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [62]
120 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
121 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [47]
122 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [46]
123 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23]
124 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24]
125 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [5..11,57]
126 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
127 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [63]
128 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25]
129 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
130 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [64]
131 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
132 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [48]
133 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [49]
134 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
135 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
136 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
137 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
138 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [32]
139 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
140 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
141 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [33]
142 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [34]
143 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [35]
144 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", # [36]
145 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
146 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
147 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [65]
148 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
149 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [37]
150 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [38]
151 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25]
152 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26]
153 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27]
154 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [50]
155 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00\x00\x00\x00\x00", # [28..38,47]
156 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [57]
157 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [39]
158 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [40]
159 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [41]
160 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
161 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [42]
162 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [43]
163 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15\x00\x00\x00\x00", # [44,48..50]
164 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [45]
165);
166
167157µsour %DeadBits = (
168 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\x0a", # [0..65]
169 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [29]
170 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [30]
171 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6]
172 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1]
173 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22]
174 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2]
175 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31]
176 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7]
177 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3]
178 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\xa2\x2a\x00", # [51..56,58..62]
179 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [58]
180 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [59]
181 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [52]
182 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [55]
183 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [60]
184 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [61]
185 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [53]
186 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [56]
187 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [54]
188 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [62]
189 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4]
190 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [47]
191 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [46]
192 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23]
193 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24]
194 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [5..11,57]
195 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8]
196 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [63]
197 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25]
198 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12]
199 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [64]
200 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9]
201 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [48]
202 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [49]
203 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13]
204 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14]
205 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15]
206 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16]
207 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [32]
208 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10]
209 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17]
210 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [33]
211 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [34]
212 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [35]
213 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", # [36]
214 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18]
215 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19]
216 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [65]
217 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20]
218 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [37]
219 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [38]
220 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25]
221 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26]
222 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27]
223 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [50]
224 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00\x00\x00\x00\x00", # [28..38,47]
225 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [57]
226 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [39]
227 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [40]
228 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [41]
229 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11]
230 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [42]
231 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [43]
232 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a\x00\x00\x00\x00", # [44,48..50]
233 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [45]
234);
235
236# These are used by various things, including our own tests
23712µsour $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
23812µsour $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x55\x00", # [2,58,59,52,55,60,61,53,56,54,62,4,63,22,23,25]
239our $LAST_BIT = 132 ;
24011µsour $BYTES = 17 ;
241
242257µsour $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ;
243
244sub Croaker
245{
246 require Carp; # this initializes %CarpInternal
247 local $Carp::CarpInternal{'warnings'};
248 delete $Carp::CarpInternal{'warnings'};
249 Carp::croak(@_);
250}
251
252sub _bits {
253 my $mask = shift ;
254 my $catmask ;
255 my $fatal = 0 ;
256 my $no_fatal = 0 ;
257
258 foreach my $word ( @_ ) {
259 if ($word eq 'FATAL') {
260 $fatal = 1;
261 $no_fatal = 0;
262 }
263 elsif ($word eq 'NONFATAL') {
264 $fatal = 0;
265 $no_fatal = 1;
266 }
267 elsif ($catmask = $Bits{$word}) {
268 $mask |= $catmask ;
269 $mask |= $DeadBits{$word} if $fatal ;
270 $mask &= ~($DeadBits{$word}|$All) if $no_fatal ;
271 }
272 else
273 { Croaker("Unknown warnings category '$word'")}
274 }
275
276 return $mask ;
277}
278
279sub bits
280{
281 # called from B::Deparse.pm
282 push @_, 'all' unless @_ ;
283 return _bits(undef, @_) ;
284}
285
286sub import
287
# spent 462µs within warnings::import which was called 32 times, avg 14µs/call: # once (76µs+0s) by main::BEGIN@20 at line 20 of /usr/sbin/pkg_info # once (53µs+0s) by IO::Uncompress::Gunzip::BEGIN@9 at line 9 of IO/Uncompress/Gunzip.pm # once (20µs+0s) by OpenBSD::State::BEGIN@19 at line 19 of OpenBSD/Subst.pm # once (19µs+0s) by IO::Compress::Base::Common::BEGIN@4 at line 4 of IO/Compress/Base/Common.pm # once (18µs+0s) by IO::Compress::Base::Common::BEGIN@522 at line 522 of IO/Compress/Base/Common.pm # once (16µs+0s) by OpenBSD::State::BEGIN@18.5 at line 18 of OpenBSD/Error.pm # once (15µs+0s) by main::BEGIN@20.2 at line 20 of OpenBSD/PkgInfo.pm # once (15µs+0s) by IO::Uncompress::RawInflate::BEGIN@5 at line 5 of IO/Uncompress/RawInflate.pm # once (14µs+0s) by File::GlobMapper::BEGIN@4 at line 4 of File/GlobMapper.pm # once (14µs+0s) by Carp::BEGIN@5 at line 5 of Carp.pm # once (13µs+0s) by main::BEGIN@20.4 at line 20 of OpenBSD/State.pm # once (12µs+0s) by OpenBSD::PackageLocation::BEGIN@21 at line 21 of OpenBSD/Ustar.pm # once (12µs+0s) by Compress::Raw::Zlib::BEGIN@9 at line 9 of Compress/Raw/Zlib.pm # once (12µs+0s) by OpenBSD::PkgInfo::State::BEGIN@19 at line 19 of OpenBSD/PackageInfo.pm # once (11µs+0s) by IO::Compress::Zlib::Extra::BEGIN@6 at line 6 of IO/Compress/Zlib/Extra.pm # once (11µs+0s) by IO::Uncompress::Adapter::Inflate::BEGIN@4 at line 4 of IO/Uncompress/Adapter/Inflate.pm # once (11µs+0s) by IO::Uncompress::Base::BEGIN@5 at line 5 of IO/Uncompress/Base.pm # once (10µs+0s) by IO::BEGIN@8 at line 8 of IO.pm # once (9µs+0s) by OpenBSD::State::BEGIN@19.9 at line 19 of OpenBSD/PackageLocator.pm # once (9µs+0s) by IO::Compress::Gzip::Constants::BEGIN@4 at line 4 of IO/Compress/Gzip/Constants.pm # once (8µs+0s) by OpenBSD::PkgInfo::BEGIN@19 at line 19 of OpenBSD/Search.pm # once (8µs+0s) by OpenBSD::PkgInfo::BEGIN@22 at line 22 of OpenBSD/Getopt.pm # once (8µs+0s) by OpenBSD::PackageLocator::BEGIN@19.11 at line 19 of OpenBSD/PackageRepository.pm # once (8µs+0s) by OpenBSD::PackageInfo::BEGIN@19.7 at line 19 of OpenBSD/Paths.pm # once (8µs+0s) by OpenBSD::Ustar::BEGIN@18 at line 18 of OpenBSD/IdCache.pm # once (8µs+0s) by OpenBSD::PackageInfo::BEGIN@19 at line 19 of OpenBSD/PackageName.pm # once (8µs+0s) by File::Basename::BEGIN@52 at line 52 of File/Basename.pm # once (8µs+0s) by OpenBSD::PackageLocator::BEGIN@19 at line 19 of OpenBSD/PackageRepositoryList.pm # once (7µs+0s) by OpenBSD::PackageRepository::BEGIN@19 at line 19 of OpenBSD/PackageLocation.pm # once (7µs+0s) by OpenBSD::PackageLocation::BEGIN@19 at line 19 of OpenBSD/Temp.pm # once (7µs+0s) by OpenBSD::PackageLocator::BEGIN@19.14 at line 19 of OpenBSD/PackageRepository/Installed.pm # once (7µs+0s) by OpenBSD::MkTemp::BEGIN@5 at line 5 of OpenBSD/MkTemp.pm
{
2883226µs shift;
289
29032117µs my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
291
2923266µs if (vec($mask, $Offsets{'all'}, 1)) {
29312µs $mask |= $Bits{'all'} ;
29412µs $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
295 }
296
297 # append 'all' when implied (after a lone "FATAL" or "NONFATAL")
2983236µs push @_, 'all' if @_==1 && ( $_[0] eq 'FATAL' || $_[0] eq 'NONFATAL' );
299
300 # Empty @_ is equivalent to @_ = 'all' ;
30132371µs ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ;
302}
303
304sub unimport
305
# spent 323µs within warnings::unimport which was called 10 times, avg 32µs/call: # once (73µs+0s) by File::Glob::BEGIN@54 at line 54 of File/Glob.pm # once (57µs+0s) by Carp::BEGIN@6 at line 24 of Carp.pm # once (35µs+0s) by File::GlobMapper::BEGIN@341 at line 341 of File/GlobMapper.pm # once (31µs+0s) by Carp::BEGIN@605 at line 605 of Carp.pm # once (24µs+0s) by U64::BEGIN@1038 at line 1038 of IO/Compress/Base/Common.pm # once (22µs+0s) by OpenBSD::PackageRepository::BEGIN@117 at line 117 of OpenBSD/PackageRepository.pm # once (22µs+0s) by IO::Uncompress::Base::BEGIN@90 at line 90 of IO/Uncompress/Base.pm # once (21µs+0s) by OpenBSD::Ustar::BEGIN@221 at line 221 of OpenBSD/Ustar.pm # once (20µs+0s) by IO::Uncompress::Base::BEGIN@428 at line 428 of IO/Uncompress/Base.pm # once (18µs+0s) by Exporter::Heavy::BEGIN@202 at line 202 of Exporter/Heavy.pm
{
306108µs shift;
307
308109µs my $catmask ;
3091055µs my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ;
310
3111027µs if (vec($mask, $Offsets{'all'}, 1)) {
312711µs $mask |= $Bits{'all'} ;
313711µs $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1);
314 }
315
316 # append 'all' when implied (empty import list or after a lone "FATAL")
3171037µs push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL';
318
3191031µs foreach my $word ( @_ ) {
3201082µs if ($word eq 'FATAL') {
321 next;
322 }
323 elsif ($catmask = $Bits{$word}) {
324 $mask &= ~($catmask | $DeadBits{$word} | $All);
325 }
326 else
327 { Croaker("Unknown warnings category '$word'")}
328 }
329
33010102µs ${^WARNING_BITS} = $mask ;
331}
332
33328µsmy %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = ();
334
335sub MESSAGE () { 4 };
336sub FATAL () { 2 };
337sub NORMAL () { 1 };
338
339sub __chk
340{
341 my $category ;
342 my $offset ;
343 my $isobj = 0 ;
344 my $wanted = shift;
345 my $has_message = $wanted & MESSAGE;
346
347 unless (@_ == 1 || @_ == ($has_message ? 2 : 0)) {
348 my $sub = (caller 1)[3];
349 my $syntax = $has_message ? "[category,] 'message'" : '[category]';
350 Croaker("Usage: $sub($syntax)");
351 }
352
353 my $message = pop if $has_message;
354
355 if (@_) {
356 # check the category supplied.
357 $category = shift ;
358 if (my $type = ref $category) {
359 Croaker("not an object")
360 if exists $builtin_type{$type};
361 $category = $type;
362 $isobj = 1 ;
363 }
364 $offset = $Offsets{$category};
365 Croaker("Unknown warnings category '$category'")
366 unless defined $offset;
367 }
368 else {
369 $category = (caller(1))[0] ;
370 $offset = $Offsets{$category};
371 Croaker("package '$category' not registered for warnings")
372 unless defined $offset ;
373 }
374
375 my $i;
376
377 if ($isobj) {
378 my $pkg;
379 $i = 2;
380 while (do { { package DB; $pkg = (caller($i++))[0] } } ) {
381 last unless @DB::args && $DB::args[0] =~ /^$category=/ ;
382 }
383 $i -= 2 ;
384 }
385 else {
386 $i = _error_loc(); # see where Carp will allocate the error
387 }
388
389 # Default to 0 if caller returns nothing. Default to $DEFAULT if it
390 # explicitly returns undef.
391 my(@callers_bitmask) = (caller($i))[9] ;
392 my $callers_bitmask =
393 @callers_bitmask ? $callers_bitmask[0] // $DEFAULT : 0 ;
394
395 my @results;
396 foreach my $type (FATAL, NORMAL) {
397 next unless $wanted & $type;
398
399 push @results, (vec($callers_bitmask, $offset + $type - 1, 1) ||
400 vec($callers_bitmask, $Offsets{'all'} + $type - 1, 1));
401 }
402
403 # &enabled and &fatal_enabled
404 return $results[0] unless $has_message;
405
406 # &warnif, and the category is neither enabled as warning nor as fatal
407 return if $wanted == (NORMAL | FATAL | MESSAGE)
408 && !($results[0] || $results[1]);
409
410 require Carp;
411 Carp::croak($message) if $results[0];
412 # will always get here for &warn. will only get here for &warnif if the
413 # category is enabled
414 Carp::carp($message);
415}
416
417sub _mkMask
418
# spent 35µs within warnings::_mkMask which was called 4 times, avg 9µs/call: # 2 times (25µs+0s) by warnings::register_categories at line 432, avg 13µs/call # 2 times (10µs+0s) by warnings::register_categories at line 438, avg 5µs/call
{
41944µs my ($bit) = @_;
42046µs my $mask = "";
421
422413µs vec($mask, $bit, 1) = 1;
423432µs return $mask;
424}
425
426sub register_categories
427
# spent 399µs (364+35) within warnings::register_categories which was called 2 times, avg 200µs/call: # 2 times (364µs+35µs) by warnings::register::import at line 23 of warnings/register.pm, avg 200µs/call
{
42823µs my @names = @_;
429
430212µs for my $name (@names) {
43126µs if (! defined $Bits{$name}) {
432214µs225µs $Bits{$name} = _mkMask($LAST_BIT);
# spent 25µs making 2 calls to warnings::_mkMask, avg 13µs/call
43326µs vec($Bits{'all'}, $LAST_BIT, 1) = 1;
43425µs $Offsets{$name} = $LAST_BIT ++;
435232µs foreach my $k (keys %Bits) {
436135255µs vec($Bits{$k}, $LAST_BIT, 1) = 0;
437 }
43828µs210µs $DeadBits{$name} = _mkMask($LAST_BIT);
# spent 10µs making 2 calls to warnings::_mkMask, avg 5µs/call
43923µs vec($DeadBits{'all'}, $LAST_BIT++, 1) = 1;
440 }
441 }
442}
443
444sub _error_loc {
445 require Carp;
446 goto &Carp::short_error_loc; # don't introduce another stack frame
447}
448
449sub enabled
450{
451 return __chk(NORMAL, @_);
452}
453
454sub fatal_enabled
455{
456 return __chk(FATAL, @_);
457}
458
459sub warn
460{
461 return __chk(FATAL | MESSAGE, @_);
462}
463
464sub warnif
465{
466 return __chk(NORMAL | FATAL | MESSAGE, @_);
467}
468
469# These are not part of any public interface, so we can delete them to save
470# space.
471125µsdelete @warnings::{qw(NORMAL FATAL MESSAGE)};
472
4731113µs1;
474__END__
 
# spent 14µs within warnings::CORE:match which was called: # once (14µs+0s) by main::BEGIN@20 at line 14
sub warnings::CORE:match; # opcode