xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/lib/warnings/op (revision 0:68f95e015346)
1*0Sstevel@tonic-gate  op.c		AOK
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate     Found = in conditional, should be ==
4*0Sstevel@tonic-gate	1 if $a = 1 ;
5*0Sstevel@tonic-gate
6*0Sstevel@tonic-gate     Use of implicit split to @_ is deprecated
7*0Sstevel@tonic-gate	split ;
8*0Sstevel@tonic-gate
9*0Sstevel@tonic-gate     Use of implicit split to @_ is deprecated
10*0Sstevel@tonic-gate	$a = split ;
11*0Sstevel@tonic-gate
12*0Sstevel@tonic-gate     Useless use of time in void context
13*0Sstevel@tonic-gate     Useless use of a variable in void context
14*0Sstevel@tonic-gate     Useless use of a constant in void context
15*0Sstevel@tonic-gate	time ;
16*0Sstevel@tonic-gate	$a ;
17*0Sstevel@tonic-gate	"abc"
18*0Sstevel@tonic-gate
19*0Sstevel@tonic-gate     Useless use of sort in scalar context
20*0Sstevel@tonic-gate	my $x = sort (2,1,3);
21*0Sstevel@tonic-gate
22*0Sstevel@tonic-gate     Applying %s to %s will act on scalar(%s)
23*0Sstevel@tonic-gate	my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
24*0Sstevel@tonic-gate	@a =~ /abc/ ;
25*0Sstevel@tonic-gate	@a =~ s/a/b/ ;
26*0Sstevel@tonic-gate	@a =~ tr/a/b/ ;
27*0Sstevel@tonic-gate	@$b =~ /abc/ ;
28*0Sstevel@tonic-gate	@$b =~ s/a/b/ ;
29*0Sstevel@tonic-gate	@$b =~ tr/a/b/ ;
30*0Sstevel@tonic-gate	%a =~ /abc/ ;
31*0Sstevel@tonic-gate	%a =~ s/a/b/ ;
32*0Sstevel@tonic-gate	%a =~ tr/a/b/ ;
33*0Sstevel@tonic-gate	%$c =~ /abc/ ;
34*0Sstevel@tonic-gate	%$c =~ s/a/b/ ;
35*0Sstevel@tonic-gate	%$c =~ tr/a/b/ ;
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate     Parentheses missing around "my" list at -e line 1.
39*0Sstevel@tonic-gate       my $a, $b = (1,2);
40*0Sstevel@tonic-gate
41*0Sstevel@tonic-gate     Parentheses missing around "local" list at -e line 1.
42*0Sstevel@tonic-gate       local $a, $b = (1,2);
43*0Sstevel@tonic-gate
44*0Sstevel@tonic-gate     Bareword found in conditional at -e line 1.
45*0Sstevel@tonic-gate       use warnings 'bareword'; my $x = print(ABC || 1);
46*0Sstevel@tonic-gate
47*0Sstevel@tonic-gate     Value of %s may be \"0\"; use \"defined\"
48*0Sstevel@tonic-gate	$x = 1 if $x = <FH> ;
49*0Sstevel@tonic-gate	$x = 1 while $x = <FH> ;
50*0Sstevel@tonic-gate
51*0Sstevel@tonic-gate     Subroutine fred redefined at -e line 1.
52*0Sstevel@tonic-gate       sub fred{1;} sub fred{1;}
53*0Sstevel@tonic-gate
54*0Sstevel@tonic-gate     Constant subroutine %s redefined
55*0Sstevel@tonic-gate        sub fred() {1;} sub fred() {1;}
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gate     Format FRED redefined at /tmp/x line 5.
58*0Sstevel@tonic-gate       format FRED =
59*0Sstevel@tonic-gate       .
60*0Sstevel@tonic-gate       format FRED =
61*0Sstevel@tonic-gate       .
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gate     Array @%s missing the @ in argument %d of %s()
64*0Sstevel@tonic-gate	push fred ;
65*0Sstevel@tonic-gate
66*0Sstevel@tonic-gate     Hash %%%s missing the %% in argument %d of %s()
67*0Sstevel@tonic-gate	keys joe ;
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate     Statement unlikely to be reached
70*0Sstevel@tonic-gate     	(Maybe you meant system() when you said exec()?
71*0Sstevel@tonic-gate 	exec "true" ; my $a
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gate     defined(@array) is deprecated
74*0Sstevel@tonic-gate     	(Maybe you should just omit the defined()?)
75*0Sstevel@tonic-gate	my @a ; defined @a ;
76*0Sstevel@tonic-gate	defined (@a = (1,2,3)) ;
77*0Sstevel@tonic-gate
78*0Sstevel@tonic-gate     defined(%hash) is deprecated
79*0Sstevel@tonic-gate     	(Maybe you should just omit the defined()?)
80*0Sstevel@tonic-gate	my %h ; defined %h ;
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gate     /---/ should probably be written as "---"
83*0Sstevel@tonic-gate        join(/---/, @foo);
84*0Sstevel@tonic-gate
85*0Sstevel@tonic-gate    %s() called too early to check prototype		[Perl_peep]
86*0Sstevel@tonic-gate        fred() ; sub fred ($$) {}
87*0Sstevel@tonic-gate
88*0Sstevel@tonic-gate
89*0Sstevel@tonic-gate     Use of "package" with no arguments is deprecated
90*0Sstevel@tonic-gate	package;
91*0Sstevel@tonic-gate
92*0Sstevel@tonic-gate    Package `%s' not found (did you use the incorrect case?)
93*0Sstevel@tonic-gate
94*0Sstevel@tonic-gate    Use of /g modifier is meaningless in split
95*0Sstevel@tonic-gate
96*0Sstevel@tonic-gate    Possible precedence problem on bitwise %c operator	[Perl_ck_bitop]
97*0Sstevel@tonic-gate
98*0Sstevel@tonic-gate    Mandatory Warnings
99*0Sstevel@tonic-gate    ------------------
100*0Sstevel@tonic-gate    Prototype mismatch:		[cv_ckproto]
101*0Sstevel@tonic-gate        sub fred() ;
102*0Sstevel@tonic-gate        sub fred($) {}
103*0Sstevel@tonic-gate
104*0Sstevel@tonic-gate    Runaway prototype		[newSUB]	TODO
105*0Sstevel@tonic-gate    oops: oopsAV		[oopsAV]	TODO
106*0Sstevel@tonic-gate    oops: oopsHV		[oopsHV]	TODO
107*0Sstevel@tonic-gate
108*0Sstevel@tonic-gate__END__
109*0Sstevel@tonic-gate# op.c
110*0Sstevel@tonic-gateuse warnings 'syntax' ;
111*0Sstevel@tonic-gate1 if $a = 1 ;
112*0Sstevel@tonic-gateno warnings 'syntax' ;
113*0Sstevel@tonic-gate1 if $a = 1 ;
114*0Sstevel@tonic-gateEXPECT
115*0Sstevel@tonic-gateFound = in conditional, should be == at - line 3.
116*0Sstevel@tonic-gate########
117*0Sstevel@tonic-gate# op.c
118*0Sstevel@tonic-gateuse warnings 'deprecated' ;
119*0Sstevel@tonic-gatesplit ;
120*0Sstevel@tonic-gateno warnings 'deprecated' ;
121*0Sstevel@tonic-gatesplit ;
122*0Sstevel@tonic-gateEXPECT
123*0Sstevel@tonic-gateUse of implicit split to @_ is deprecated at - line 3.
124*0Sstevel@tonic-gate########
125*0Sstevel@tonic-gate# op.c
126*0Sstevel@tonic-gateuse warnings 'deprecated' ;
127*0Sstevel@tonic-gate$a = split ;
128*0Sstevel@tonic-gateno warnings 'deprecated' ;
129*0Sstevel@tonic-gate$a = split ;
130*0Sstevel@tonic-gateEXPECT
131*0Sstevel@tonic-gateUse of implicit split to @_ is deprecated at - line 3.
132*0Sstevel@tonic-gate########
133*0Sstevel@tonic-gate# op.c
134*0Sstevel@tonic-gateuse warnings 'deprecated';
135*0Sstevel@tonic-gatemy (@foo, %foo);
136*0Sstevel@tonic-gate%main::foo->{"bar"};
137*0Sstevel@tonic-gate%foo->{"bar"};
138*0Sstevel@tonic-gate@main::foo->[23];
139*0Sstevel@tonic-gate@foo->[23];
140*0Sstevel@tonic-gate$main::foo = {}; %$main::foo->{"bar"};
141*0Sstevel@tonic-gate$foo = {}; %$foo->{"bar"};
142*0Sstevel@tonic-gate$main::foo = []; @$main::foo->[34];
143*0Sstevel@tonic-gate$foo = []; @$foo->[34];
144*0Sstevel@tonic-gateno warnings 'deprecated';
145*0Sstevel@tonic-gate%main::foo->{"bar"};
146*0Sstevel@tonic-gate%foo->{"bar"};
147*0Sstevel@tonic-gate@main::foo->[23];
148*0Sstevel@tonic-gate@foo->[23];
149*0Sstevel@tonic-gate$main::foo = {}; %$main::foo->{"bar"};
150*0Sstevel@tonic-gate$foo = {}; %$foo->{"bar"};
151*0Sstevel@tonic-gate$main::foo = []; @$main::foo->[34];
152*0Sstevel@tonic-gate$foo = []; @$foo->[34];
153*0Sstevel@tonic-gateEXPECT
154*0Sstevel@tonic-gateUsing a hash as a reference is deprecated at - line 4.
155*0Sstevel@tonic-gateUsing a hash as a reference is deprecated at - line 5.
156*0Sstevel@tonic-gateUsing an array as a reference is deprecated at - line 6.
157*0Sstevel@tonic-gateUsing an array as a reference is deprecated at - line 7.
158*0Sstevel@tonic-gateUsing a hash as a reference is deprecated at - line 8.
159*0Sstevel@tonic-gateUsing a hash as a reference is deprecated at - line 9.
160*0Sstevel@tonic-gateUsing an array as a reference is deprecated at - line 10.
161*0Sstevel@tonic-gateUsing an array as a reference is deprecated at - line 11.
162*0Sstevel@tonic-gate########
163*0Sstevel@tonic-gate# op.c
164*0Sstevel@tonic-gateuse warnings 'void' ; close STDIN ;
165*0Sstevel@tonic-gate1 x 3 ;			# OP_REPEAT
166*0Sstevel@tonic-gate			# OP_GVSV
167*0Sstevel@tonic-gatewantarray ; 		# OP_WANTARRAY
168*0Sstevel@tonic-gate			# OP_GV
169*0Sstevel@tonic-gate			# OP_PADSV
170*0Sstevel@tonic-gate			# OP_PADAV
171*0Sstevel@tonic-gate			# OP_PADHV
172*0Sstevel@tonic-gate			# OP_PADANY
173*0Sstevel@tonic-gate			# OP_AV2ARYLEN
174*0Sstevel@tonic-gateref ;			# OP_REF
175*0Sstevel@tonic-gate\@a ;			# OP_REFGEN
176*0Sstevel@tonic-gate\$a ;			# OP_SREFGEN
177*0Sstevel@tonic-gatedefined $a ;		# OP_DEFINED
178*0Sstevel@tonic-gatehex $a ;		# OP_HEX
179*0Sstevel@tonic-gateoct $a ;		# OP_OCT
180*0Sstevel@tonic-gatelength $a ;		# OP_LENGTH
181*0Sstevel@tonic-gatesubstr $a,1 ;		# OP_SUBSTR
182*0Sstevel@tonic-gatevec $a,1,2 ;		# OP_VEC
183*0Sstevel@tonic-gateindex $a,1,2 ;		# OP_INDEX
184*0Sstevel@tonic-gaterindex $a,1,2 ;		# OP_RINDEX
185*0Sstevel@tonic-gatesprintf $a ;		# OP_SPRINTF
186*0Sstevel@tonic-gate$a[0] ;			# OP_AELEM
187*0Sstevel@tonic-gate			# OP_AELEMFAST
188*0Sstevel@tonic-gate@a[0] ;			# OP_ASLICE
189*0Sstevel@tonic-gate#values %a ;		# OP_VALUES
190*0Sstevel@tonic-gate#keys %a ;		# OP_KEYS
191*0Sstevel@tonic-gate$a{0} ;			# OP_HELEM
192*0Sstevel@tonic-gate@a{0} ;			# OP_HSLICE
193*0Sstevel@tonic-gateunpack "a", "a" ;	# OP_UNPACK
194*0Sstevel@tonic-gatepack $a,"" ;		# OP_PACK
195*0Sstevel@tonic-gatejoin "" ;		# OP_JOIN
196*0Sstevel@tonic-gate(@a)[0,1] ;		# OP_LSLICE
197*0Sstevel@tonic-gate			# OP_ANONLIST
198*0Sstevel@tonic-gate			# OP_ANONHASH
199*0Sstevel@tonic-gatesort(1,2) ;		# OP_SORT
200*0Sstevel@tonic-gatereverse(1,2) ;		# OP_REVERSE
201*0Sstevel@tonic-gate			# OP_RANGE
202*0Sstevel@tonic-gate			# OP_FLIP
203*0Sstevel@tonic-gate(1 ..2) ;		# OP_FLOP
204*0Sstevel@tonic-gatecaller ;		# OP_CALLER
205*0Sstevel@tonic-gatefileno STDIN ;		# OP_FILENO
206*0Sstevel@tonic-gateeof STDIN ;		# OP_EOF
207*0Sstevel@tonic-gatetell STDIN ;		# OP_TELL
208*0Sstevel@tonic-gatereadlink 1;		# OP_READLINK
209*0Sstevel@tonic-gatetime ;			# OP_TIME
210*0Sstevel@tonic-gatelocaltime ;		# OP_LOCALTIME
211*0Sstevel@tonic-gategmtime ;		# OP_GMTIME
212*0Sstevel@tonic-gateeval { getgrnam 1 };	# OP_GGRNAM
213*0Sstevel@tonic-gateeval { getgrgid 1 };	# OP_GGRGID
214*0Sstevel@tonic-gateeval { getpwnam 1 };	# OP_GPWNAM
215*0Sstevel@tonic-gateeval { getpwuid 1 };	# OP_GPWUID
216*0Sstevel@tonic-gateprototype "foo";	# OP_PROTOTYPE
217*0Sstevel@tonic-gateEXPECT
218*0Sstevel@tonic-gateUseless use of repeat (x) in void context at - line 3.
219*0Sstevel@tonic-gateUseless use of wantarray in void context at - line 5.
220*0Sstevel@tonic-gateUseless use of reference-type operator in void context at - line 12.
221*0Sstevel@tonic-gateUseless use of reference constructor in void context at - line 13.
222*0Sstevel@tonic-gateUseless use of single ref constructor in void context at - line 14.
223*0Sstevel@tonic-gateUseless use of defined operator in void context at - line 15.
224*0Sstevel@tonic-gateUseless use of hex in void context at - line 16.
225*0Sstevel@tonic-gateUseless use of oct in void context at - line 17.
226*0Sstevel@tonic-gateUseless use of length in void context at - line 18.
227*0Sstevel@tonic-gateUseless use of substr in void context at - line 19.
228*0Sstevel@tonic-gateUseless use of vec in void context at - line 20.
229*0Sstevel@tonic-gateUseless use of index in void context at - line 21.
230*0Sstevel@tonic-gateUseless use of rindex in void context at - line 22.
231*0Sstevel@tonic-gateUseless use of sprintf in void context at - line 23.
232*0Sstevel@tonic-gateUseless use of array element in void context at - line 24.
233*0Sstevel@tonic-gateUseless use of array slice in void context at - line 26.
234*0Sstevel@tonic-gateUseless use of hash element in void context at - line 29.
235*0Sstevel@tonic-gateUseless use of hash slice in void context at - line 30.
236*0Sstevel@tonic-gateUseless use of unpack in void context at - line 31.
237*0Sstevel@tonic-gateUseless use of pack in void context at - line 32.
238*0Sstevel@tonic-gateUseless use of join or string in void context at - line 33.
239*0Sstevel@tonic-gateUseless use of list slice in void context at - line 34.
240*0Sstevel@tonic-gateUseless use of sort in void context at - line 37.
241*0Sstevel@tonic-gateUseless use of reverse in void context at - line 38.
242*0Sstevel@tonic-gateUseless use of range (or flop) in void context at - line 41.
243*0Sstevel@tonic-gateUseless use of caller in void context at - line 42.
244*0Sstevel@tonic-gateUseless use of fileno in void context at - line 43.
245*0Sstevel@tonic-gateUseless use of eof in void context at - line 44.
246*0Sstevel@tonic-gateUseless use of tell in void context at - line 45.
247*0Sstevel@tonic-gateUseless use of readlink in void context at - line 46.
248*0Sstevel@tonic-gateUseless use of time in void context at - line 47.
249*0Sstevel@tonic-gateUseless use of localtime in void context at - line 48.
250*0Sstevel@tonic-gateUseless use of gmtime in void context at - line 49.
251*0Sstevel@tonic-gateUseless use of getgrnam in void context at - line 50.
252*0Sstevel@tonic-gateUseless use of getgrgid in void context at - line 51.
253*0Sstevel@tonic-gateUseless use of getpwnam in void context at - line 52.
254*0Sstevel@tonic-gateUseless use of getpwuid in void context at - line 53.
255*0Sstevel@tonic-gateUseless use of subroutine prototype in void context at - line 54.
256*0Sstevel@tonic-gate########
257*0Sstevel@tonic-gate# op.c
258*0Sstevel@tonic-gateuse warnings 'void' ; close STDIN ;
259*0Sstevel@tonic-gatemy $x = sort (2,1,3);
260*0Sstevel@tonic-gateno warnings 'void' ;
261*0Sstevel@tonic-gate$x = sort (2,1,3);
262*0Sstevel@tonic-gateEXPECT
263*0Sstevel@tonic-gateUseless use of sort in scalar context at - line 3.
264*0Sstevel@tonic-gate########
265*0Sstevel@tonic-gate# op.c
266*0Sstevel@tonic-gateno warnings 'void' ; close STDIN ;
267*0Sstevel@tonic-gate1 x 3 ;			# OP_REPEAT
268*0Sstevel@tonic-gate			# OP_GVSV
269*0Sstevel@tonic-gatewantarray ; 		# OP_WANTARRAY
270*0Sstevel@tonic-gate			# OP_GV
271*0Sstevel@tonic-gate			# OP_PADSV
272*0Sstevel@tonic-gate			# OP_PADAV
273*0Sstevel@tonic-gate			# OP_PADHV
274*0Sstevel@tonic-gate			# OP_PADANY
275*0Sstevel@tonic-gate			# OP_AV2ARYLEN
276*0Sstevel@tonic-gateref ;			# OP_REF
277*0Sstevel@tonic-gate\@a ;			# OP_REFGEN
278*0Sstevel@tonic-gate\$a ;			# OP_SREFGEN
279*0Sstevel@tonic-gatedefined $a ;		# OP_DEFINED
280*0Sstevel@tonic-gatehex $a ;		# OP_HEX
281*0Sstevel@tonic-gateoct $a ;		# OP_OCT
282*0Sstevel@tonic-gatelength $a ;		# OP_LENGTH
283*0Sstevel@tonic-gatesubstr $a,1 ;		# OP_SUBSTR
284*0Sstevel@tonic-gatevec $a,1,2 ;		# OP_VEC
285*0Sstevel@tonic-gateindex $a,1,2 ;		# OP_INDEX
286*0Sstevel@tonic-gaterindex $a,1,2 ;		# OP_RINDEX
287*0Sstevel@tonic-gatesprintf $a ;		# OP_SPRINTF
288*0Sstevel@tonic-gate$a[0] ;			# OP_AELEM
289*0Sstevel@tonic-gate			# OP_AELEMFAST
290*0Sstevel@tonic-gate@a[0] ;			# OP_ASLICE
291*0Sstevel@tonic-gate#values %a ;		# OP_VALUES
292*0Sstevel@tonic-gate#keys %a ;		# OP_KEYS
293*0Sstevel@tonic-gate$a{0} ;			# OP_HELEM
294*0Sstevel@tonic-gate@a{0} ;			# OP_HSLICE
295*0Sstevel@tonic-gateunpack "a", "a" ;	# OP_UNPACK
296*0Sstevel@tonic-gatepack $a,"" ;		# OP_PACK
297*0Sstevel@tonic-gatejoin "" ;		# OP_JOIN
298*0Sstevel@tonic-gate(@a)[0,1] ;		# OP_LSLICE
299*0Sstevel@tonic-gate			# OP_ANONLIST
300*0Sstevel@tonic-gate			# OP_ANONHASH
301*0Sstevel@tonic-gatesort(1,2) ;		# OP_SORT
302*0Sstevel@tonic-gatereverse(1,2) ;		# OP_REVERSE
303*0Sstevel@tonic-gate			# OP_RANGE
304*0Sstevel@tonic-gate			# OP_FLIP
305*0Sstevel@tonic-gate(1 ..2) ;		# OP_FLOP
306*0Sstevel@tonic-gatecaller ;		# OP_CALLER
307*0Sstevel@tonic-gatefileno STDIN ;		# OP_FILENO
308*0Sstevel@tonic-gateeof STDIN ;		# OP_EOF
309*0Sstevel@tonic-gatetell STDIN ;		# OP_TELL
310*0Sstevel@tonic-gatereadlink 1;		# OP_READLINK
311*0Sstevel@tonic-gatetime ;			# OP_TIME
312*0Sstevel@tonic-gatelocaltime ;		# OP_LOCALTIME
313*0Sstevel@tonic-gategmtime ;		# OP_GMTIME
314*0Sstevel@tonic-gateeval { getgrnam 1 };	# OP_GGRNAM
315*0Sstevel@tonic-gateeval { getgrgid 1 };	# OP_GGRGID
316*0Sstevel@tonic-gateeval { getpwnam 1 };	# OP_GPWNAM
317*0Sstevel@tonic-gateeval { getpwuid 1 };	# OP_GPWUID
318*0Sstevel@tonic-gateprototype "foo";	# OP_PROTOTYPE
319*0Sstevel@tonic-gateEXPECT
320*0Sstevel@tonic-gate########
321*0Sstevel@tonic-gate# op.c
322*0Sstevel@tonic-gateuse warnings 'void' ;
323*0Sstevel@tonic-gatefor (@{[0]}) { "$_" }		# check warning isn't duplicated
324*0Sstevel@tonic-gateno warnings 'void' ;
325*0Sstevel@tonic-gatefor (@{[0]}) { "$_" }		# check warning isn't duplicated
326*0Sstevel@tonic-gateEXPECT
327*0Sstevel@tonic-gateUseless use of string in void context at - line 3.
328*0Sstevel@tonic-gate########
329*0Sstevel@tonic-gate# op.c
330*0Sstevel@tonic-gateuse warnings 'void' ;
331*0Sstevel@tonic-gateuse Config ;
332*0Sstevel@tonic-gateBEGIN {
333*0Sstevel@tonic-gate    if ( ! $Config{d_telldir}) {
334*0Sstevel@tonic-gate        print <<EOM ;
335*0Sstevel@tonic-gateSKIPPED
336*0Sstevel@tonic-gate# telldir not present
337*0Sstevel@tonic-gateEOM
338*0Sstevel@tonic-gate        exit
339*0Sstevel@tonic-gate    }
340*0Sstevel@tonic-gate}
341*0Sstevel@tonic-gatetelldir 1 ;		# OP_TELLDIR
342*0Sstevel@tonic-gateno warnings 'void' ;
343*0Sstevel@tonic-gatetelldir 1 ;		# OP_TELLDIR
344*0Sstevel@tonic-gateEXPECT
345*0Sstevel@tonic-gateUseless use of telldir in void context at - line 13.
346*0Sstevel@tonic-gate########
347*0Sstevel@tonic-gate# op.c
348*0Sstevel@tonic-gateuse warnings 'void' ;
349*0Sstevel@tonic-gateuse Config ;
350*0Sstevel@tonic-gateBEGIN {
351*0Sstevel@tonic-gate    if ( ! $Config{d_getppid}) {
352*0Sstevel@tonic-gate        print <<EOM ;
353*0Sstevel@tonic-gateSKIPPED
354*0Sstevel@tonic-gate# getppid not present
355*0Sstevel@tonic-gateEOM
356*0Sstevel@tonic-gate        exit
357*0Sstevel@tonic-gate    }
358*0Sstevel@tonic-gate}
359*0Sstevel@tonic-gategetppid ;		# OP_GETPPID
360*0Sstevel@tonic-gateno warnings 'void' ;
361*0Sstevel@tonic-gategetppid ;		# OP_GETPPID
362*0Sstevel@tonic-gateEXPECT
363*0Sstevel@tonic-gateUseless use of getppid in void context at - line 13.
364*0Sstevel@tonic-gate########
365*0Sstevel@tonic-gate# op.c
366*0Sstevel@tonic-gateuse warnings 'void' ;
367*0Sstevel@tonic-gateuse Config ;
368*0Sstevel@tonic-gateBEGIN {
369*0Sstevel@tonic-gate    if ( ! $Config{d_getpgrp}) {
370*0Sstevel@tonic-gate        print <<EOM ;
371*0Sstevel@tonic-gateSKIPPED
372*0Sstevel@tonic-gate# getpgrp not present
373*0Sstevel@tonic-gateEOM
374*0Sstevel@tonic-gate        exit
375*0Sstevel@tonic-gate    }
376*0Sstevel@tonic-gate}
377*0Sstevel@tonic-gategetpgrp ;		# OP_GETPGRP
378*0Sstevel@tonic-gateno warnings 'void' ;
379*0Sstevel@tonic-gategetpgrp ;		# OP_GETPGRP
380*0Sstevel@tonic-gateEXPECT
381*0Sstevel@tonic-gateUseless use of getpgrp in void context at - line 13.
382*0Sstevel@tonic-gate########
383*0Sstevel@tonic-gate# op.c
384*0Sstevel@tonic-gateuse warnings 'void' ;
385*0Sstevel@tonic-gateuse Config ;
386*0Sstevel@tonic-gateBEGIN {
387*0Sstevel@tonic-gate    if ( ! $Config{d_times}) {
388*0Sstevel@tonic-gate        print <<EOM ;
389*0Sstevel@tonic-gateSKIPPED
390*0Sstevel@tonic-gate# times not present
391*0Sstevel@tonic-gateEOM
392*0Sstevel@tonic-gate        exit
393*0Sstevel@tonic-gate    }
394*0Sstevel@tonic-gate}
395*0Sstevel@tonic-gatetimes ;			# OP_TMS
396*0Sstevel@tonic-gateno warnings 'void' ;
397*0Sstevel@tonic-gatetimes ;			# OP_TMS
398*0Sstevel@tonic-gateEXPECT
399*0Sstevel@tonic-gateUseless use of times in void context at - line 13.
400*0Sstevel@tonic-gate########
401*0Sstevel@tonic-gate# op.c
402*0Sstevel@tonic-gateuse warnings 'void' ;
403*0Sstevel@tonic-gateuse Config ;
404*0Sstevel@tonic-gateBEGIN {
405*0Sstevel@tonic-gate    if ( ! $Config{d_getprior} or $^O eq 'os2') { # Locks before fixpak22
406*0Sstevel@tonic-gate        print <<EOM ;
407*0Sstevel@tonic-gateSKIPPED
408*0Sstevel@tonic-gate# getpriority not present
409*0Sstevel@tonic-gateEOM
410*0Sstevel@tonic-gate        exit
411*0Sstevel@tonic-gate    }
412*0Sstevel@tonic-gate}
413*0Sstevel@tonic-gategetpriority 1,2;	# OP_GETPRIORITY
414*0Sstevel@tonic-gateno warnings 'void' ;
415*0Sstevel@tonic-gategetpriority 1,2;	# OP_GETPRIORITY
416*0Sstevel@tonic-gateEXPECT
417*0Sstevel@tonic-gateUseless use of getpriority in void context at - line 13.
418*0Sstevel@tonic-gate########
419*0Sstevel@tonic-gate# op.c
420*0Sstevel@tonic-gateuse warnings 'void' ;
421*0Sstevel@tonic-gateuse Config ;
422*0Sstevel@tonic-gateBEGIN {
423*0Sstevel@tonic-gate    if ( ! $Config{d_getlogin}) {
424*0Sstevel@tonic-gate        print <<EOM ;
425*0Sstevel@tonic-gateSKIPPED
426*0Sstevel@tonic-gate# getlogin not present
427*0Sstevel@tonic-gateEOM
428*0Sstevel@tonic-gate        exit
429*0Sstevel@tonic-gate    }
430*0Sstevel@tonic-gate}
431*0Sstevel@tonic-gategetlogin ;			# OP_GETLOGIN
432*0Sstevel@tonic-gateno warnings 'void' ;
433*0Sstevel@tonic-gategetlogin ;			# OP_GETLOGIN
434*0Sstevel@tonic-gateEXPECT
435*0Sstevel@tonic-gateUseless use of getlogin in void context at - line 13.
436*0Sstevel@tonic-gate########
437*0Sstevel@tonic-gate# op.c
438*0Sstevel@tonic-gateuse warnings 'void' ;
439*0Sstevel@tonic-gateuse Config ; BEGIN {
440*0Sstevel@tonic-gateif ( ! $Config{d_socket}) {
441*0Sstevel@tonic-gate    print <<EOM ;
442*0Sstevel@tonic-gateSKIPPED
443*0Sstevel@tonic-gate# getsockname not present
444*0Sstevel@tonic-gate# getpeername not present
445*0Sstevel@tonic-gate# gethostbyname not present
446*0Sstevel@tonic-gate# gethostbyaddr not present
447*0Sstevel@tonic-gate# gethostent not present
448*0Sstevel@tonic-gate# getnetbyname not present
449*0Sstevel@tonic-gate# getnetbyaddr not present
450*0Sstevel@tonic-gate# getnetent not present
451*0Sstevel@tonic-gate# getprotobyname not present
452*0Sstevel@tonic-gate# getprotobynumber not present
453*0Sstevel@tonic-gate# getprotoent not present
454*0Sstevel@tonic-gate# getservbyname not present
455*0Sstevel@tonic-gate# getservbyport not present
456*0Sstevel@tonic-gate# getservent not present
457*0Sstevel@tonic-gateEOM
458*0Sstevel@tonic-gate    exit
459*0Sstevel@tonic-gate} }
460*0Sstevel@tonic-gategetsockname STDIN ;	# OP_GETSOCKNAME
461*0Sstevel@tonic-gategetpeername STDIN ;	# OP_GETPEERNAME
462*0Sstevel@tonic-gategethostbyname 1 ;	# OP_GHBYNAME
463*0Sstevel@tonic-gategethostbyaddr 1,2;	# OP_GHBYADDR
464*0Sstevel@tonic-gategethostent ;		# OP_GHOSTENT
465*0Sstevel@tonic-gategetnetbyname 1 ;	# OP_GNBYNAME
466*0Sstevel@tonic-gategetnetbyaddr 1,2 ;	# OP_GNBYADDR
467*0Sstevel@tonic-gategetnetent ;		# OP_GNETENT
468*0Sstevel@tonic-gategetprotobyname 1;	# OP_GPBYNAME
469*0Sstevel@tonic-gategetprotobynumber 1;	# OP_GPBYNUMBER
470*0Sstevel@tonic-gategetprotoent ;		# OP_GPROTOENT
471*0Sstevel@tonic-gategetservbyname 1,2;	# OP_GSBYNAME
472*0Sstevel@tonic-gategetservbyport 1,2;	# OP_GSBYPORT
473*0Sstevel@tonic-gategetservent ;		# OP_GSERVENT
474*0Sstevel@tonic-gate
475*0Sstevel@tonic-gateno warnings 'void' ;
476*0Sstevel@tonic-gategetsockname STDIN ;	# OP_GETSOCKNAME
477*0Sstevel@tonic-gategetpeername STDIN ;	# OP_GETPEERNAME
478*0Sstevel@tonic-gategethostbyname 1 ;	# OP_GHBYNAME
479*0Sstevel@tonic-gategethostbyaddr 1,2;	# OP_GHBYADDR
480*0Sstevel@tonic-gategethostent ;		# OP_GHOSTENT
481*0Sstevel@tonic-gategetnetbyname 1 ;	# OP_GNBYNAME
482*0Sstevel@tonic-gategetnetbyaddr 1,2 ;	# OP_GNBYADDR
483*0Sstevel@tonic-gategetnetent ;		# OP_GNETENT
484*0Sstevel@tonic-gategetprotobyname 1;	# OP_GPBYNAME
485*0Sstevel@tonic-gategetprotobynumber 1;	# OP_GPBYNUMBER
486*0Sstevel@tonic-gategetprotoent ;		# OP_GPROTOENT
487*0Sstevel@tonic-gategetservbyname 1,2;	# OP_GSBYNAME
488*0Sstevel@tonic-gategetservbyport 1,2;	# OP_GSBYPORT
489*0Sstevel@tonic-gategetservent ;		# OP_GSERVENT
490*0Sstevel@tonic-gateINIT {
491*0Sstevel@tonic-gate   # some functions may not be there, so we exit without running
492*0Sstevel@tonic-gate   exit;
493*0Sstevel@tonic-gate}
494*0Sstevel@tonic-gateEXPECT
495*0Sstevel@tonic-gateUseless use of getsockname in void context at - line 24.
496*0Sstevel@tonic-gateUseless use of getpeername in void context at - line 25.
497*0Sstevel@tonic-gateUseless use of gethostbyname in void context at - line 26.
498*0Sstevel@tonic-gateUseless use of gethostbyaddr in void context at - line 27.
499*0Sstevel@tonic-gateUseless use of gethostent in void context at - line 28.
500*0Sstevel@tonic-gateUseless use of getnetbyname in void context at - line 29.
501*0Sstevel@tonic-gateUseless use of getnetbyaddr in void context at - line 30.
502*0Sstevel@tonic-gateUseless use of getnetent in void context at - line 31.
503*0Sstevel@tonic-gateUseless use of getprotobyname in void context at - line 32.
504*0Sstevel@tonic-gateUseless use of getprotobynumber in void context at - line 33.
505*0Sstevel@tonic-gateUseless use of getprotoent in void context at - line 34.
506*0Sstevel@tonic-gateUseless use of getservbyname in void context at - line 35.
507*0Sstevel@tonic-gateUseless use of getservbyport in void context at - line 36.
508*0Sstevel@tonic-gateUseless use of getservent in void context at - line 37.
509*0Sstevel@tonic-gate########
510*0Sstevel@tonic-gate# op.c
511*0Sstevel@tonic-gateuse warnings 'void' ;
512*0Sstevel@tonic-gate*a ; # OP_RV2GV
513*0Sstevel@tonic-gate$a ; # OP_RV2SV
514*0Sstevel@tonic-gate@a ; # OP_RV2AV
515*0Sstevel@tonic-gate%a ; # OP_RV2HV
516*0Sstevel@tonic-gateno warnings 'void' ;
517*0Sstevel@tonic-gate*a ; # OP_RV2GV
518*0Sstevel@tonic-gate$a ; # OP_RV2SV
519*0Sstevel@tonic-gate@a ; # OP_RV2AV
520*0Sstevel@tonic-gate%a ; # OP_RV2HV
521*0Sstevel@tonic-gateEXPECT
522*0Sstevel@tonic-gateUseless use of a variable in void context at - line 3.
523*0Sstevel@tonic-gateUseless use of a variable in void context at - line 4.
524*0Sstevel@tonic-gateUseless use of a variable in void context at - line 5.
525*0Sstevel@tonic-gateUseless use of a variable in void context at - line 6.
526*0Sstevel@tonic-gate########
527*0Sstevel@tonic-gate# op.c
528*0Sstevel@tonic-gateuse warnings 'void' ;
529*0Sstevel@tonic-gate"abc"; # OP_CONST
530*0Sstevel@tonic-gate7 ; # OP_CONST
531*0Sstevel@tonic-gate5 || print "bad\n";	# test OPpCONST_SHORTCIRCUIT
532*0Sstevel@tonic-gateuse constant U => undef;
533*0Sstevel@tonic-gateprint "boo\n" if U;	# test OPpCONST_SHORTCIRCUIT
534*0Sstevel@tonic-gateno warnings 'void' ;
535*0Sstevel@tonic-gate"abc"; # OP_CONST
536*0Sstevel@tonic-gate7 ; # OP_CONST
537*0Sstevel@tonic-gateEXPECT
538*0Sstevel@tonic-gateUseless use of a constant in void context at - line 3.
539*0Sstevel@tonic-gateUseless use of a constant in void context at - line 4.
540*0Sstevel@tonic-gate########
541*0Sstevel@tonic-gate# op.c
542*0Sstevel@tonic-gate#
543*0Sstevel@tonic-gateuse warnings 'misc' ;
544*0Sstevel@tonic-gatemy $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
545*0Sstevel@tonic-gate@a =~ /abc/ ;
546*0Sstevel@tonic-gate@a =~ s/a/b/ ;
547*0Sstevel@tonic-gate@a =~ tr/a/b/ ;
548*0Sstevel@tonic-gate@$b =~ /abc/ ;
549*0Sstevel@tonic-gate@$b =~ s/a/b/ ;
550*0Sstevel@tonic-gate@$b =~ tr/a/b/ ;
551*0Sstevel@tonic-gate%a =~ /abc/ ;
552*0Sstevel@tonic-gate%a =~ s/a/b/ ;
553*0Sstevel@tonic-gate%a =~ tr/a/b/ ;
554*0Sstevel@tonic-gate%$c =~ /abc/ ;
555*0Sstevel@tonic-gate%$c =~ s/a/b/ ;
556*0Sstevel@tonic-gate%$c =~ tr/a/b/ ;
557*0Sstevel@tonic-gate{
558*0Sstevel@tonic-gateno warnings 'misc' ;
559*0Sstevel@tonic-gatemy $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
560*0Sstevel@tonic-gate@a =~ /abc/ ;
561*0Sstevel@tonic-gate@a =~ s/a/b/ ;
562*0Sstevel@tonic-gate@a =~ tr/a/b/ ;
563*0Sstevel@tonic-gate@$b =~ /abc/ ;
564*0Sstevel@tonic-gate@$b =~ s/a/b/ ;
565*0Sstevel@tonic-gate@$b =~ tr/a/b/ ;
566*0Sstevel@tonic-gate%a =~ /abc/ ;
567*0Sstevel@tonic-gate%a =~ s/a/b/ ;
568*0Sstevel@tonic-gate%a =~ tr/a/b/ ;
569*0Sstevel@tonic-gate%$c =~ /abc/ ;
570*0Sstevel@tonic-gate%$c =~ s/a/b/ ;
571*0Sstevel@tonic-gate%$c =~ tr/a/b/ ;
572*0Sstevel@tonic-gate}
573*0Sstevel@tonic-gateEXPECT
574*0Sstevel@tonic-gateApplying pattern match (m//) to @array will act on scalar(@array) at - line 5.
575*0Sstevel@tonic-gateApplying substitution (s///) to @array will act on scalar(@array) at - line 6.
576*0Sstevel@tonic-gateApplying transliteration (tr///) to @array will act on scalar(@array) at - line 7.
577*0Sstevel@tonic-gateApplying pattern match (m//) to @array will act on scalar(@array) at - line 8.
578*0Sstevel@tonic-gateApplying substitution (s///) to @array will act on scalar(@array) at - line 9.
579*0Sstevel@tonic-gateApplying transliteration (tr///) to @array will act on scalar(@array) at - line 10.
580*0Sstevel@tonic-gateApplying pattern match (m//) to %hash will act on scalar(%hash) at - line 11.
581*0Sstevel@tonic-gateApplying substitution (s///) to %hash will act on scalar(%hash) at - line 12.
582*0Sstevel@tonic-gateApplying transliteration (tr///) to %hash will act on scalar(%hash) at - line 13.
583*0Sstevel@tonic-gateApplying pattern match (m//) to %hash will act on scalar(%hash) at - line 14.
584*0Sstevel@tonic-gateApplying substitution (s///) to %hash will act on scalar(%hash) at - line 15.
585*0Sstevel@tonic-gateApplying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16.
586*0Sstevel@tonic-gateCan't modify private array in substitution (s///) at - line 6, near "s/a/b/ ;"
587*0Sstevel@tonic-gateBEGIN not safe after errors--compilation aborted at - line 18.
588*0Sstevel@tonic-gate########
589*0Sstevel@tonic-gate# op.c
590*0Sstevel@tonic-gateuse warnings 'parenthesis' ;
591*0Sstevel@tonic-gatemy $a, $b = (1,2);
592*0Sstevel@tonic-gatemy @foo,%bar,	$quux; # there's a TAB here
593*0Sstevel@tonic-gatemy $x, $y or print;
594*0Sstevel@tonic-gateno warnings 'parenthesis' ;
595*0Sstevel@tonic-gatemy $c, $d = (1,2);
596*0Sstevel@tonic-gateEXPECT
597*0Sstevel@tonic-gateParentheses missing around "my" list at - line 3.
598*0Sstevel@tonic-gateParentheses missing around "my" list at - line 4.
599*0Sstevel@tonic-gate########
600*0Sstevel@tonic-gate# op.c
601*0Sstevel@tonic-gateuse warnings 'parenthesis' ;
602*0Sstevel@tonic-gateour $a, $b = (1,2);
603*0Sstevel@tonic-gateno warnings 'parenthesis' ;
604*0Sstevel@tonic-gateour $c, $d = (1,2);
605*0Sstevel@tonic-gateEXPECT
606*0Sstevel@tonic-gateParentheses missing around "our" list at - line 3.
607*0Sstevel@tonic-gate########
608*0Sstevel@tonic-gate# op.c
609*0Sstevel@tonic-gateuse warnings 'parenthesis' ;
610*0Sstevel@tonic-gatelocal $a, $b = (1,2);
611*0Sstevel@tonic-gatelocal *f, *g;
612*0Sstevel@tonic-gateno warnings 'parenthesis' ;
613*0Sstevel@tonic-gatelocal $c, $d = (1,2);
614*0Sstevel@tonic-gateEXPECT
615*0Sstevel@tonic-gateParentheses missing around "local" list at - line 3.
616*0Sstevel@tonic-gateParentheses missing around "local" list at - line 4.
617*0Sstevel@tonic-gate########
618*0Sstevel@tonic-gate# op.c
619*0Sstevel@tonic-gateuse warnings 'bareword' ;
620*0Sstevel@tonic-gateprint (ABC || 1) ;
621*0Sstevel@tonic-gateno warnings 'bareword' ;
622*0Sstevel@tonic-gateprint (ABC || 1) ;
623*0Sstevel@tonic-gateEXPECT
624*0Sstevel@tonic-gateBareword found in conditional at - line 3.
625*0Sstevel@tonic-gate########
626*0Sstevel@tonic-gate--FILE-- abc
627*0Sstevel@tonic-gate
628*0Sstevel@tonic-gate--FILE--
629*0Sstevel@tonic-gate# op.c
630*0Sstevel@tonic-gateuse warnings 'misc' ;
631*0Sstevel@tonic-gateopen FH, "<abc" ;
632*0Sstevel@tonic-gate$x = 1 if $x = <FH> ;
633*0Sstevel@tonic-gateno warnings 'misc' ;
634*0Sstevel@tonic-gate$x = 1 if $x = <FH> ;
635*0Sstevel@tonic-gateEXPECT
636*0Sstevel@tonic-gateValue of <HANDLE> construct can be "0"; test with defined() at - line 4.
637*0Sstevel@tonic-gate########
638*0Sstevel@tonic-gate# op.c
639*0Sstevel@tonic-gateuse warnings 'misc' ;
640*0Sstevel@tonic-gateopendir FH, "." ;
641*0Sstevel@tonic-gate$x = 1 if $x = readdir FH ;
642*0Sstevel@tonic-gateno warnings 'misc' ;
643*0Sstevel@tonic-gate$x = 1 if $x = readdir FH ;
644*0Sstevel@tonic-gateclosedir FH ;
645*0Sstevel@tonic-gateEXPECT
646*0Sstevel@tonic-gateValue of readdir() operator can be "0"; test with defined() at - line 4.
647*0Sstevel@tonic-gate########
648*0Sstevel@tonic-gate# op.c
649*0Sstevel@tonic-gateuse warnings 'misc' ;
650*0Sstevel@tonic-gate$x = 1 if $x = <*> ;
651*0Sstevel@tonic-gateno warnings 'misc' ;
652*0Sstevel@tonic-gate$x = 1 if $x = <*> ;
653*0Sstevel@tonic-gateEXPECT
654*0Sstevel@tonic-gateValue of glob construct can be "0"; test with defined() at - line 3.
655*0Sstevel@tonic-gate########
656*0Sstevel@tonic-gate# op.c
657*0Sstevel@tonic-gateuse warnings 'misc' ;
658*0Sstevel@tonic-gate%a = (1,2,3,4) ;
659*0Sstevel@tonic-gate$x = 1 if $x = each %a ;
660*0Sstevel@tonic-gateno warnings 'misc' ;
661*0Sstevel@tonic-gate$x = 1 if $x = each %a ;
662*0Sstevel@tonic-gateEXPECT
663*0Sstevel@tonic-gateValue of each() operator can be "0"; test with defined() at - line 4.
664*0Sstevel@tonic-gate########
665*0Sstevel@tonic-gate# op.c
666*0Sstevel@tonic-gateuse warnings 'misc' ;
667*0Sstevel@tonic-gate$x = 1 while $x = <*> and 0 ;
668*0Sstevel@tonic-gateno warnings 'misc' ;
669*0Sstevel@tonic-gate$x = 1 while $x = <*> and 0 ;
670*0Sstevel@tonic-gateEXPECT
671*0Sstevel@tonic-gateValue of glob construct can be "0"; test with defined() at - line 3.
672*0Sstevel@tonic-gate########
673*0Sstevel@tonic-gate# op.c
674*0Sstevel@tonic-gateuse warnings 'misc' ;
675*0Sstevel@tonic-gateopendir FH, "." ;
676*0Sstevel@tonic-gate$x = 1 while $x = readdir FH and 0 ;
677*0Sstevel@tonic-gateno warnings 'misc' ;
678*0Sstevel@tonic-gate$x = 1 while $x = readdir FH and 0 ;
679*0Sstevel@tonic-gateclosedir FH ;
680*0Sstevel@tonic-gateEXPECT
681*0Sstevel@tonic-gateValue of readdir() operator can be "0"; test with defined() at - line 4.
682*0Sstevel@tonic-gate########
683*0Sstevel@tonic-gate# op.c
684*0Sstevel@tonic-gateuse warnings 'redefine' ;
685*0Sstevel@tonic-gatesub fred {}
686*0Sstevel@tonic-gatesub fred {}
687*0Sstevel@tonic-gateno warnings 'redefine' ;
688*0Sstevel@tonic-gatesub fred {}
689*0Sstevel@tonic-gateEXPECT
690*0Sstevel@tonic-gateSubroutine fred redefined at - line 4.
691*0Sstevel@tonic-gate########
692*0Sstevel@tonic-gate# op.c
693*0Sstevel@tonic-gateuse warnings 'redefine' ;
694*0Sstevel@tonic-gatesub fred () { 1 }
695*0Sstevel@tonic-gatesub fred () { 1 }
696*0Sstevel@tonic-gateno warnings 'redefine' ;
697*0Sstevel@tonic-gatesub fred () { 1 }
698*0Sstevel@tonic-gateEXPECT
699*0Sstevel@tonic-gateConstant subroutine fred redefined at - line 4.
700*0Sstevel@tonic-gate########
701*0Sstevel@tonic-gate# op.c
702*0Sstevel@tonic-gateno warnings 'redefine' ;
703*0Sstevel@tonic-gatesub fred () { 1 }
704*0Sstevel@tonic-gatesub fred () { 2 }
705*0Sstevel@tonic-gateEXPECT
706*0Sstevel@tonic-gateConstant subroutine fred redefined at - line 4.
707*0Sstevel@tonic-gate########
708*0Sstevel@tonic-gate# op.c
709*0Sstevel@tonic-gateno warnings 'redefine' ;
710*0Sstevel@tonic-gatesub fred () { 1 }
711*0Sstevel@tonic-gate*fred = sub () { 2 };
712*0Sstevel@tonic-gateEXPECT
713*0Sstevel@tonic-gateConstant subroutine main::fred redefined at - line 4.
714*0Sstevel@tonic-gate########
715*0Sstevel@tonic-gate# op.c
716*0Sstevel@tonic-gateuse warnings 'redefine' ;
717*0Sstevel@tonic-gateformat FRED =
718*0Sstevel@tonic-gate.
719*0Sstevel@tonic-gateformat FRED =
720*0Sstevel@tonic-gate.
721*0Sstevel@tonic-gateno warnings 'redefine' ;
722*0Sstevel@tonic-gateformat FRED =
723*0Sstevel@tonic-gate.
724*0Sstevel@tonic-gateEXPECT
725*0Sstevel@tonic-gateFormat FRED redefined at - line 5.
726*0Sstevel@tonic-gate########
727*0Sstevel@tonic-gate# op.c
728*0Sstevel@tonic-gateuse warnings 'deprecated' ;
729*0Sstevel@tonic-gatepush FRED;
730*0Sstevel@tonic-gateno warnings 'deprecated' ;
731*0Sstevel@tonic-gatepush FRED;
732*0Sstevel@tonic-gateEXPECT
733*0Sstevel@tonic-gateArray @FRED missing the @ in argument 1 of push() at - line 3.
734*0Sstevel@tonic-gate########
735*0Sstevel@tonic-gate# op.c
736*0Sstevel@tonic-gateuse warnings 'deprecated' ;
737*0Sstevel@tonic-gate@a = keys FRED ;
738*0Sstevel@tonic-gateno warnings 'deprecated' ;
739*0Sstevel@tonic-gate@a = keys FRED ;
740*0Sstevel@tonic-gateEXPECT
741*0Sstevel@tonic-gateHash %FRED missing the % in argument 1 of keys() at - line 3.
742*0Sstevel@tonic-gate########
743*0Sstevel@tonic-gate# op.c
744*0Sstevel@tonic-gateBEGIN {
745*0Sstevel@tonic-gate    if ($^O eq 'MacOS') {
746*0Sstevel@tonic-gate	print <<EOM;
747*0Sstevel@tonic-gateSKIPPED
748*0Sstevel@tonic-gate# no exec on Mac OS
749*0Sstevel@tonic-gateEOM
750*0Sstevel@tonic-gate	exit;
751*0Sstevel@tonic-gate    }
752*0Sstevel@tonic-gate}
753*0Sstevel@tonic-gateuse warnings 'syntax' ;
754*0Sstevel@tonic-gateexec "$^X -e 1" ;
755*0Sstevel@tonic-gatemy $a
756*0Sstevel@tonic-gateEXPECT
757*0Sstevel@tonic-gateStatement unlikely to be reached at - line 13.
758*0Sstevel@tonic-gate	(Maybe you meant system() when you said exec()?)
759*0Sstevel@tonic-gate########
760*0Sstevel@tonic-gate# op.c
761*0Sstevel@tonic-gateuse warnings 'deprecated' ;
762*0Sstevel@tonic-gatemy @a; defined(@a);
763*0Sstevel@tonic-gateEXPECT
764*0Sstevel@tonic-gatedefined(@array) is deprecated at - line 3.
765*0Sstevel@tonic-gate	(Maybe you should just omit the defined()?)
766*0Sstevel@tonic-gate########
767*0Sstevel@tonic-gate# op.c
768*0Sstevel@tonic-gateuse warnings 'deprecated' ;
769*0Sstevel@tonic-gatedefined(@a = (1,2,3));
770*0Sstevel@tonic-gateEXPECT
771*0Sstevel@tonic-gatedefined(@array) is deprecated at - line 3.
772*0Sstevel@tonic-gate	(Maybe you should just omit the defined()?)
773*0Sstevel@tonic-gate########
774*0Sstevel@tonic-gate# op.c
775*0Sstevel@tonic-gateuse warnings 'deprecated' ;
776*0Sstevel@tonic-gatemy %h; defined(%h);
777*0Sstevel@tonic-gateEXPECT
778*0Sstevel@tonic-gatedefined(%hash) is deprecated at - line 3.
779*0Sstevel@tonic-gate	(Maybe you should just omit the defined()?)
780*0Sstevel@tonic-gate########
781*0Sstevel@tonic-gate# op.c
782*0Sstevel@tonic-gateBEGIN {
783*0Sstevel@tonic-gate    if ($^O eq 'MacOS') {
784*0Sstevel@tonic-gate	print <<EOM;
785*0Sstevel@tonic-gateSKIPPED
786*0Sstevel@tonic-gate# no exec on Mac OS
787*0Sstevel@tonic-gateEOM
788*0Sstevel@tonic-gate	exit;
789*0Sstevel@tonic-gate    }
790*0Sstevel@tonic-gate}
791*0Sstevel@tonic-gateno warnings 'syntax' ;
792*0Sstevel@tonic-gateexec "$^X -e 1" ;
793*0Sstevel@tonic-gatemy $a
794*0Sstevel@tonic-gateEXPECT
795*0Sstevel@tonic-gate
796*0Sstevel@tonic-gate########
797*0Sstevel@tonic-gate# op.c
798*0Sstevel@tonic-gatesub fred();
799*0Sstevel@tonic-gatesub fred($) {}
800*0Sstevel@tonic-gateEXPECT
801*0Sstevel@tonic-gatePrototype mismatch: sub main::fred () vs ($) at - line 3.
802*0Sstevel@tonic-gate########
803*0Sstevel@tonic-gate# op.c
804*0Sstevel@tonic-gate$^W = 0 ;
805*0Sstevel@tonic-gatesub fred() ;
806*0Sstevel@tonic-gatesub fred($) {}
807*0Sstevel@tonic-gate{
808*0Sstevel@tonic-gate    no warnings 'prototype' ;
809*0Sstevel@tonic-gate    sub Fred() ;
810*0Sstevel@tonic-gate    sub Fred($) {}
811*0Sstevel@tonic-gate    use warnings 'prototype' ;
812*0Sstevel@tonic-gate    sub freD() ;
813*0Sstevel@tonic-gate    sub freD($) {}
814*0Sstevel@tonic-gate}
815*0Sstevel@tonic-gatesub FRED() ;
816*0Sstevel@tonic-gatesub FRED($) {}
817*0Sstevel@tonic-gateEXPECT
818*0Sstevel@tonic-gatePrototype mismatch: sub main::fred () vs ($) at - line 4.
819*0Sstevel@tonic-gatePrototype mismatch: sub main::freD () vs ($) at - line 11.
820*0Sstevel@tonic-gatePrototype mismatch: sub main::FRED () vs ($) at - line 14.
821*0Sstevel@tonic-gate########
822*0Sstevel@tonic-gate# op.c
823*0Sstevel@tonic-gateuse warnings 'syntax' ;
824*0Sstevel@tonic-gatejoin /---/, 'x', 'y', 'z';
825*0Sstevel@tonic-gateEXPECT
826*0Sstevel@tonic-gate/---/ should probably be written as "---" at - line 3.
827*0Sstevel@tonic-gate########
828*0Sstevel@tonic-gate# op.c [Perl_peep]
829*0Sstevel@tonic-gateuse warnings 'prototype' ;
830*0Sstevel@tonic-gatefred() ;
831*0Sstevel@tonic-gatesub fred ($$) {}
832*0Sstevel@tonic-gateno warnings 'prototype' ;
833*0Sstevel@tonic-gatejoe() ;
834*0Sstevel@tonic-gatesub joe ($$) {}
835*0Sstevel@tonic-gateEXPECT
836*0Sstevel@tonic-gatemain::fred() called too early to check prototype at - line 3.
837*0Sstevel@tonic-gate########
838*0Sstevel@tonic-gate# op.c [Perl_newATTRSUB]
839*0Sstevel@tonic-gate--FILE-- abc.pm
840*0Sstevel@tonic-gateuse warnings 'void' ;
841*0Sstevel@tonic-gateBEGIN { $| = 1; print "in begin\n"; }
842*0Sstevel@tonic-gateCHECK { print "in check\n"; }
843*0Sstevel@tonic-gateINIT { print "in init\n"; }
844*0Sstevel@tonic-gateEND { print "in end\n"; }
845*0Sstevel@tonic-gateprint "in mainline\n";
846*0Sstevel@tonic-gate1;
847*0Sstevel@tonic-gate--FILE--
848*0Sstevel@tonic-gateuse abc;
849*0Sstevel@tonic-gatedelete $INC{"abc.pm"};
850*0Sstevel@tonic-gaterequire abc;
851*0Sstevel@tonic-gatedo "abc.pm";
852*0Sstevel@tonic-gateEXPECT
853*0Sstevel@tonic-gatein begin
854*0Sstevel@tonic-gatein mainline
855*0Sstevel@tonic-gatein check
856*0Sstevel@tonic-gatein init
857*0Sstevel@tonic-gatein begin
858*0Sstevel@tonic-gateToo late to run CHECK block at abc.pm line 3.
859*0Sstevel@tonic-gateToo late to run INIT block at abc.pm line 4.
860*0Sstevel@tonic-gatein mainline
861*0Sstevel@tonic-gatein begin
862*0Sstevel@tonic-gateToo late to run CHECK block at abc.pm line 3.
863*0Sstevel@tonic-gateToo late to run INIT block at abc.pm line 4.
864*0Sstevel@tonic-gatein mainline
865*0Sstevel@tonic-gatein end
866*0Sstevel@tonic-gatein end
867*0Sstevel@tonic-gatein end
868*0Sstevel@tonic-gate########
869*0Sstevel@tonic-gate# op.c [Perl_newATTRSUB]
870*0Sstevel@tonic-gate--FILE-- abc.pm
871*0Sstevel@tonic-gateno warnings 'void' ;
872*0Sstevel@tonic-gateBEGIN { $| = 1; print "in begin\n"; }
873*0Sstevel@tonic-gateCHECK { print "in check\n"; }
874*0Sstevel@tonic-gateINIT { print "in init\n"; }
875*0Sstevel@tonic-gateEND { print "in end\n"; }
876*0Sstevel@tonic-gateprint "in mainline\n";
877*0Sstevel@tonic-gate1;
878*0Sstevel@tonic-gate--FILE--
879*0Sstevel@tonic-gaterequire abc;
880*0Sstevel@tonic-gatedo "abc.pm";
881*0Sstevel@tonic-gateEXPECT
882*0Sstevel@tonic-gatein begin
883*0Sstevel@tonic-gatein mainline
884*0Sstevel@tonic-gatein begin
885*0Sstevel@tonic-gatein mainline
886*0Sstevel@tonic-gatein end
887*0Sstevel@tonic-gatein end
888*0Sstevel@tonic-gate########
889*0Sstevel@tonic-gate# op.c
890*0Sstevel@tonic-gatemy @x;
891*0Sstevel@tonic-gateuse warnings 'syntax' ;
892*0Sstevel@tonic-gatepush(@x);
893*0Sstevel@tonic-gateunshift(@x);
894*0Sstevel@tonic-gateno warnings 'syntax' ;
895*0Sstevel@tonic-gatepush(@x);
896*0Sstevel@tonic-gateunshift(@x);
897*0Sstevel@tonic-gateEXPECT
898*0Sstevel@tonic-gateUseless use of push with no values at - line 4.
899*0Sstevel@tonic-gateUseless use of unshift with no values at - line 5.
900*0Sstevel@tonic-gate########
901*0Sstevel@tonic-gate# op.c
902*0Sstevel@tonic-gateuse warnings 'deprecated' ;
903*0Sstevel@tonic-gatepackage;
904*0Sstevel@tonic-gateno warnings 'deprecated' ;
905*0Sstevel@tonic-gatepackage;
906*0Sstevel@tonic-gateEXPECT
907*0Sstevel@tonic-gateUse of "package" with no arguments is deprecated at - line 3.
908*0Sstevel@tonic-gateGlobal symbol "BEGIN" requires explicit package name at - line 4.
909*0Sstevel@tonic-gateBEGIN not safe after errors--compilation aborted at - line 4.
910*0Sstevel@tonic-gate########
911*0Sstevel@tonic-gate# op.c
912*0Sstevel@tonic-gate# 20020401 mjd@plover.com at suggestion of jfriedl@yahoo.com
913*0Sstevel@tonic-gateuse warnings 'regexp';
914*0Sstevel@tonic-gatesplit /blah/g, "blah";
915*0Sstevel@tonic-gateno warnings 'regexp';
916*0Sstevel@tonic-gatesplit /blah/g, "blah";
917*0Sstevel@tonic-gateEXPECT
918*0Sstevel@tonic-gateUse of /g modifier is meaningless in split at - line 4.
919*0Sstevel@tonic-gate########
920*0Sstevel@tonic-gate# op.c
921*0Sstevel@tonic-gateuse warnings 'precedence';
922*0Sstevel@tonic-gate$a = $b & $c == $d;
923*0Sstevel@tonic-gate$a = $b ^ $c != $d;
924*0Sstevel@tonic-gate$a = $b | $c > $d;
925*0Sstevel@tonic-gate$a = $b < $c & $d;
926*0Sstevel@tonic-gate$a = $b >= $c ^ $d;
927*0Sstevel@tonic-gate$a = $b <= $c | $d;
928*0Sstevel@tonic-gate$a = $b <=> $c & $d;
929*0Sstevel@tonic-gate$a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
930*0Sstevel@tonic-gateno warnings 'precedence';
931*0Sstevel@tonic-gate$a = $b & $c == $d;
932*0Sstevel@tonic-gate$a = $b ^ $c != $d;
933*0Sstevel@tonic-gate$a = $b | $c > $d;
934*0Sstevel@tonic-gate$a = $b < $c & $d;
935*0Sstevel@tonic-gate$a = $b >= $c ^ $d;
936*0Sstevel@tonic-gate$a = $b <= $c | $d;
937*0Sstevel@tonic-gate$a = $b <=> $c & $d;
938*0Sstevel@tonic-gateEXPECT
939*0Sstevel@tonic-gatePossible precedence problem on bitwise & operator at - line 3.
940*0Sstevel@tonic-gatePossible precedence problem on bitwise ^ operator at - line 4.
941*0Sstevel@tonic-gatePossible precedence problem on bitwise | operator at - line 5.
942*0Sstevel@tonic-gatePossible precedence problem on bitwise & operator at - line 6.
943*0Sstevel@tonic-gatePossible precedence problem on bitwise ^ operator at - line 7.
944*0Sstevel@tonic-gatePossible precedence problem on bitwise | operator at - line 8.
945*0Sstevel@tonic-gatePossible precedence problem on bitwise & operator at - line 9.
946*0Sstevel@tonic-gate########
947*0Sstevel@tonic-gate# op.c
948*0Sstevel@tonic-gateuse integer;
949*0Sstevel@tonic-gateuse warnings 'precedence';
950*0Sstevel@tonic-gate$a = $b & $c == $d;
951*0Sstevel@tonic-gate$a = $b ^ $c != $d;
952*0Sstevel@tonic-gate$a = $b | $c > $d;
953*0Sstevel@tonic-gate$a = $b < $c & $d;
954*0Sstevel@tonic-gate$a = $b >= $c ^ $d;
955*0Sstevel@tonic-gate$a = $b <= $c | $d;
956*0Sstevel@tonic-gate$a = $b <=> $c & $d;
957*0Sstevel@tonic-gateno warnings 'precedence';
958*0Sstevel@tonic-gate$a = $b & $c == $d;
959*0Sstevel@tonic-gate$a = $b ^ $c != $d;
960*0Sstevel@tonic-gate$a = $b | $c > $d;
961*0Sstevel@tonic-gate$a = $b < $c & $d;
962*0Sstevel@tonic-gate$a = $b >= $c ^ $d;
963*0Sstevel@tonic-gate$a = $b <= $c | $d;
964*0Sstevel@tonic-gate$a = $b <=> $c & $d;
965*0Sstevel@tonic-gateEXPECT
966*0Sstevel@tonic-gatePossible precedence problem on bitwise & operator at - line 4.
967*0Sstevel@tonic-gatePossible precedence problem on bitwise ^ operator at - line 5.
968*0Sstevel@tonic-gatePossible precedence problem on bitwise | operator at - line 6.
969*0Sstevel@tonic-gatePossible precedence problem on bitwise & operator at - line 7.
970*0Sstevel@tonic-gatePossible precedence problem on bitwise ^ operator at - line 8.
971*0Sstevel@tonic-gatePossible precedence problem on bitwise | operator at - line 9.
972*0Sstevel@tonic-gatePossible precedence problem on bitwise & operator at - line 10.
973