xref: /openbsd/gnu/usr.bin/perl/t/lib/warnings/gv (revision 8529ddd3)
1  gv.c AOK
2
3     Can't locate package %s for @%s::ISA
4	@ISA = qw(Fred); joe()
5
6     Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated
7	sub Other::AUTOLOAD { 1 } sub Other::fred {}
8	@ISA = qw(Other) ;
9	fred() ;
10
11     $# is no longer supported
12     $* is no longer supported
13
14	$a = ${"#"} ;
15 	$a = ${"*"} ;
16
17     Name "main::a" used only once: possible typo
18
19  Mandatory Warnings ALL TODO
20  ------------------
21
22    Had to create %SVf unexpectedly		[gv_fetchpv]
23    Attempt to free unreferenced glob pointers	[gp_free]
24
25__END__
26# gv.c
27use warnings 'syntax' ;
28@ISA = qw(Fred); joe()
29EXPECT
30Can't locate package Fred for @main::ISA at - line 3.
31Undefined subroutine &main::joe called at - line 3.
32########
33# gv.c
34no warnings 'syntax' ;
35@ISA = qw(Fred); joe()
36EXPECT
37Undefined subroutine &main::joe called at - line 3.
38########
39# gv.c
40sub Other::AUTOLOAD { 1 } sub Other::fred {}
41@ISA = qw(Other) ;
42use warnings 'deprecated' ;
43fred() ;
44EXPECT
45Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 5.
46########
47# gv.c
48use utf8;
49use open qw( :utf8 :std );
50sub Oᕞʀ::AUTOLOAD { 1 } sub Oᕞʀ::fᕃƌ {}
51@ISA = qw(Oᕞʀ) ;
52use warnings 'deprecated' ;
53fᕃƌ() ;
54EXPECT
55Use of inherited AUTOLOAD for non-method main::fᕃƌ() is deprecated at - line 7.
56########
57# gv.c
58$a = ${"#"};
59$a = ${"*"};
60no warnings 'deprecated' ;
61$a = ${"#"};
62$a = ${"*"};
63EXPECT
64$# is no longer supported at - line 2.
65$* is no longer supported at - line 3.
66########
67# gv.c
68$a = ${#};
69$a = ${*};
70no warnings 'deprecated' ;
71$a = ${#};
72$a = ${*};
73EXPECT
74$# is no longer supported at - line 2.
75$* is no longer supported at - line 3.
76########
77# gv.c
78$a = $#;
79$a = $*;
80$# = $a;
81$* = $a;
82$a = \$#;
83$a = \$*;
84no warnings 'deprecated' ;
85$a = $#;
86$a = $*;
87$# = $a;
88$* = $a;
89$a = \$#;
90$a = \$*;
91EXPECT
92$# is no longer supported at - line 2.
93$* is no longer supported at - line 3.
94$# is no longer supported at - line 4.
95$* is no longer supported at - line 5.
96$# is no longer supported at - line 6.
97$* is no longer supported at - line 7.
98########
99# gv.c
100@a = @#;
101@a = @*;
102$a = $#;
103$a = $*;
104EXPECT
105$# is no longer supported at - line 4.
106$* is no longer supported at - line 5.
107########
108# gv.c
109$a = $#;
110$a = $*;
111@a = @#;
112@a = @*;
113EXPECT
114$# is no longer supported at - line 2.
115$* is no longer supported at - line 3.
116########
117# gv.c
118use warnings 'syntax' ;
119use utf8;
120use open qw( :utf8 :std );
121package Y;
122@ISA = qw(Fred); joe()
123EXPECT
124Can't locate package Fred for @Y::ISA at - line 6.
125Undefined subroutine &Y::joe called at - line 6.
126########
127# gv.c
128use warnings;
129$x = 1;
130if ($x) {
131    print $y;
132}
133$a++; # These two should
134$b++; # be exempt.
135$Foo::a++;
136$Foo::b++;
137EXPECT
138Name "main::y" used only once: possible typo at - line 5.
139Use of uninitialized value $y in print at - line 5.
140########
141# gv.c
142use warnings;
143$x = 1;
144if ($x) {
145    $x++;
146    print $y;
147}
148EXPECT
149Name "main::y" used only once: possible typo at - line 6.
150Use of uninitialized value $y in print at - line 6.
151########
152# gv.c
153use warnings;
154$x = 0;
155if ($x) {
156    print "1\n";
157} elsif (!$x) {
158    print $y;
159} else {
160    print "0\n";
161}
162EXPECT
163Name "main::y" used only once: possible typo at - line 7.
164Use of uninitialized value $y in print at - line 7.
165########
166# gv.c
167use warnings;
168$x = 0;
169if ($x) {
170    print "1\n";
171} elsif (!$x) {
172    $x++;
173    print $y;
174} else {
175    print "0\n";
176}
177EXPECT
178Name "main::y" used only once: possible typo at - line 8.
179Use of uninitialized value $y in print at - line 8.
180########
181# gv.c
182use utf8;
183use open qw( :utf8 :std );
184use warnings;
185$ㄒ = 1;
186if ($ㄒ) {
187    print $ʎ;
188}
189EXPECT
190Name "main::ʎ" used only once: possible typo at - line 7.
191Use of uninitialized value $ʎ in print at - line 7.
192########
193# gv.c
194use utf8;
195use open qw( :utf8 :std );
196use warnings;
197$ㄒ = 1;
198if ($ㄒ) {
199    $ㄒ++;
200    print $ʎ;
201}
202EXPECT
203Name "main::ʎ" used only once: possible typo at - line 8.
204Use of uninitialized value $ʎ in print at - line 8.
205########
206# gv.c
207use utf8;
208use open qw( :utf8 :std );
209use warnings;
210$ㄒ = 0;
211if ($ㄒ) {
212    print "1\n";
213} elsif (!$ㄒ) {
214    print $ʎ;
215} else {
216    print "0\n";
217}
218EXPECT
219Name "main::ʎ" used only once: possible typo at - line 9.
220Use of uninitialized value $ʎ in print at - line 9.
221########
222# gv.c
223use utf8;
224use open qw( :utf8 :std );
225use warnings;
226$ㄒ = 0;
227if ($ㄒ) {
228    print "1\n";
229} elsif (!$ㄒ) {
230    $ㄒ++;
231    print $ʎ;
232} else {
233    print "0\n";
234}
235EXPECT
236Name "main::ʎ" used only once: possible typo at - line 10.
237Use of uninitialized value $ʎ in print at - line 10.
238########
239# gv.c
240use utf8;
241use open qw( :utf8 :std );
242use warnings;
243package 팣칵ぇ;
244$ㄒ = 1;
245if ($ㄒ) {
246    print $ʎ;
247}
248EXPECT
249Name "팣칵ぇ::ʎ" used only once: possible typo at - line 8.
250Use of uninitialized value $팣칵ぇ::ʎ in print at - line 8.
251########
252# gv.c
253use utf8;
254use open qw( :utf8 :std );
255use warnings;
256package 팣칵ぇ;
257$ㄒ = 1;
258if ($ㄒ) {
259    $ㄒ++;
260    print $ʎ;
261}
262EXPECT
263Name "팣칵ぇ::ʎ" used only once: possible typo at - line 9.
264Use of uninitialized value $팣칵ぇ::ʎ in print at - line 9.
265########
266# gv.c
267use utf8;
268use open qw( :utf8 :std );
269use warnings;
270package 팣칵ぇ;
271$ㄒ = 0;
272if ($ㄒ) {
273    print "1\n";
274} elsif (!$ㄒ) {
275    print $ʎ;
276} else {
277    print "0\n";
278}
279EXPECT
280Name "팣칵ぇ::ʎ" used only once: possible typo at - line 10.
281Use of uninitialized value $팣칵ぇ::ʎ in print at - line 10.
282########
283# gv.c
284use utf8;
285use open qw( :utf8 :std );
286use warnings;
287package 팣칵ぇ;
288$ㄒ = 0;
289if ($ㄒ) {
290    print "1\n";
291} elsif (!$ㄒ) {
292    $ㄒ++;
293    print $ʎ;
294} else {
295    print "0\n";
296}
297EXPECT
298Name "팣칵ぇ::ʎ" used only once: possible typo at - line 11.
299Use of uninitialized value $팣칵ぇ::ʎ in print at - line 11.
300