This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Preserve 64-bit array offsets in uninit warnings
[perl5.git] / t / lib / warnings / gv
CommitLineData
599cee73
PM
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
8ae1fe26 11 $# is no longer supported
9b332a20 12 $* is no longer supported
599cee73
PM
13
14 $a = ${"#"} ;
15 $a = ${"*"} ;
16
e5e43984
FC
17 Name "main::a" used only once: possible typo
18
0453d815
PM
19 Mandatory Warnings ALL TODO
20 ------------------
599cee73 21
34ee6772 22 Had to create %SVf unexpectedly [gv_fetchpv]
0453d815
PM
23 Attempt to free unreferenced glob pointers [gp_free]
24
599cee73
PM
25__END__
26# gv.c
f40a7154 27use warnings 'syntax' ;
599cee73
PM
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
f40a7154 34no warnings 'syntax' ;
0453d815
PM
35@ISA = qw(Fred); joe()
36EXPECT
37Undefined subroutine &main::joe called at - line 3.
38########
39# gv.c
599cee73
PM
40sub Other::AUTOLOAD { 1 } sub Other::fred {}
41@ISA = qw(Other) ;
4438c4b7 42use warnings 'deprecated' ;
599cee73
PM
43fred() ;
44EXPECT
45Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 5.
46########
47# gv.c
34ee6772
BF
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
599cee73
PM
58$a = ${"#"};
59$a = ${"*"};
4438c4b7 60no warnings 'deprecated' ;
0453d815
PM
61$a = ${"#"};
62$a = ${"*"};
599cee73 63EXPECT
fafcdf9e 64$# is no longer supported at - line 2.
4f650b80 65$* is no longer supported at - line 3.
34ee6772
BF
66########
67# gv.c
340067e5
NC
68$a = ${#};
69$a = ${*};
70no warnings 'deprecated' ;
71$a = ${#};
72$a = ${*};
73EXPECT
74$# is no longer supported at - line 2.
4f650b80 75$* is no longer supported at - line 3.
340067e5
NC
76########
77# gv.c
78$a = $#;
79$a = $*;
ff683671
NC
80$# = $a;
81$* = $a;
82$a = \$#;
83$a = \$*;
340067e5
NC
84no warnings 'deprecated' ;
85$a = $#;
86$a = $*;
ff683671
NC
87$# = $a;
88$* = $a;
89$a = \$#;
90$a = \$*;
340067e5
NC
91EXPECT
92$# is no longer supported at - line 2.
4f650b80 93$* is no longer supported at - line 3.
ff683671 94$# is no longer supported at - line 4.
4f650b80 95$* is no longer supported at - line 5.
ff683671 96$# is no longer supported at - line 6.
4f650b80 97$* is no longer supported at - line 7.
340067e5
NC
98########
99# gv.c
ff683671
NC
100@a = @#;
101@a = @*;
102$a = $#;
103$a = $*;
340067e5 104EXPECT
ff683671 105$# is no longer supported at - line 4.
4f650b80 106$* is no longer supported at - line 5.
340067e5
NC
107########
108# gv.c
ff683671
NC
109$a = $#;
110$a = $*;
111@a = @#;
112@a = @*;
340067e5
NC
113EXPECT
114$# is no longer supported at - line 2.
4f650b80 115$* is no longer supported at - line 3.
340067e5
NC
116########
117# gv.c
34ee6772
BF
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.
e5e43984
FC
126########
127# gv.c
128use warnings;
129$x = 1;
130if ($x) {
131 print $y;
132}
ea238638
FC
133$a++; # These two should
134$b++; # be exempt.
135$Foo::a++;
136$Foo::b++;
e5e43984
FC
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.