xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/lib/warnings/6default (revision 0:68f95e015346)
1*0Sstevel@tonic-gateCheck default warnings
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate__END__
4*0Sstevel@tonic-gate# default warnings should be displayed if you don't add anything
5*0Sstevel@tonic-gate# optional shouldn't
6*0Sstevel@tonic-gatemy $a = oct "7777777777777777777777777777777777779" ;
7*0Sstevel@tonic-gateEXPECT
8*0Sstevel@tonic-gateInteger overflow in octal number at - line 3.
9*0Sstevel@tonic-gate########
10*0Sstevel@tonic-gate# no warnings should be displayed
11*0Sstevel@tonic-gateno warnings ;
12*0Sstevel@tonic-gatemy $a = oct "7777777777777777777777777777777777778" ;
13*0Sstevel@tonic-gateEXPECT
14*0Sstevel@tonic-gate########
15*0Sstevel@tonic-gate# all warnings should be displayed
16*0Sstevel@tonic-gateuse warnings ;
17*0Sstevel@tonic-gatemy $a = oct "7777777777777777777777777777777777778" ;
18*0Sstevel@tonic-gateEXPECT
19*0Sstevel@tonic-gateInteger overflow in octal number at - line 3.
20*0Sstevel@tonic-gateIllegal octal digit '8' ignored at - line 3.
21*0Sstevel@tonic-gateOctal number > 037777777777 non-portable at - line 3.
22*0Sstevel@tonic-gate########
23*0Sstevel@tonic-gate# check scope
24*0Sstevel@tonic-gateuse warnings ;
25*0Sstevel@tonic-gatemy $a = oct "7777777777777777777777777777777777778" ;
26*0Sstevel@tonic-gate{
27*0Sstevel@tonic-gate    no warnings ;
28*0Sstevel@tonic-gate    my $a = oct "7777777777777777777777777777777777778" ;
29*0Sstevel@tonic-gate}
30*0Sstevel@tonic-gatemy $c = oct "7777777777777777777777777777777777778" ;
31*0Sstevel@tonic-gateEXPECT
32*0Sstevel@tonic-gateInteger overflow in octal number at - line 3.
33*0Sstevel@tonic-gateIllegal octal digit '8' ignored at - line 3.
34*0Sstevel@tonic-gateOctal number > 037777777777 non-portable at - line 3.
35*0Sstevel@tonic-gateInteger overflow in octal number at - line 8.
36*0Sstevel@tonic-gateIllegal octal digit '8' ignored at - line 8.
37*0Sstevel@tonic-gateOctal number > 037777777777 non-portable at - line 8.
38*0Sstevel@tonic-gate########
39*0Sstevel@tonic-gate# all warnings should be displayed
40*0Sstevel@tonic-gateuse warnings ;
41*0Sstevel@tonic-gatemy $a = oct "0xfffffffffffffffffg" ;
42*0Sstevel@tonic-gateEXPECT
43*0Sstevel@tonic-gateInteger overflow in hexadecimal number at - line 3.
44*0Sstevel@tonic-gateIllegal hexadecimal digit 'g' ignored at - line 3.
45*0Sstevel@tonic-gateHexadecimal number > 0xffffffff non-portable at - line 3.
46*0Sstevel@tonic-gate########
47*0Sstevel@tonic-gate# all warnings should be displayed
48*0Sstevel@tonic-gateuse warnings ;
49*0Sstevel@tonic-gatemy $a = oct "0b111111111111111111111111111111111111111111111111111111111111111112";
50*0Sstevel@tonic-gateEXPECT
51*0Sstevel@tonic-gateInteger overflow in binary number at - line 3.
52*0Sstevel@tonic-gateIllegal binary digit '2' ignored at - line 3.
53*0Sstevel@tonic-gateBinary number > 0b11111111111111111111111111111111 non-portable at - line 3.
54*0Sstevel@tonic-gate########
55*0Sstevel@tonic-gate
56*0Sstevel@tonic-gate# Check scope of pragma with eval
57*0Sstevel@tonic-gateuse warnings;
58*0Sstevel@tonic-gate{
59*0Sstevel@tonic-gate    no warnings ;
60*0Sstevel@tonic-gate    eval '
61*0Sstevel@tonic-gate	my $a = oct "0xfffffffffffffffffg" ;
62*0Sstevel@tonic-gate    '; print STDERR $@ ;
63*0Sstevel@tonic-gate    my $a = oct "0xfffffffffffffffffg" ;
64*0Sstevel@tonic-gate}
65*0Sstevel@tonic-gateEXPECT
66*0Sstevel@tonic-gate
67*0Sstevel@tonic-gate########
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate# Check scope of pragma with eval
70*0Sstevel@tonic-gateuse warnings;
71*0Sstevel@tonic-gate{
72*0Sstevel@tonic-gate    no warnings ;
73*0Sstevel@tonic-gate    eval q[
74*0Sstevel@tonic-gate        use warnings ;
75*0Sstevel@tonic-gate	my $a = oct "0xfffffffffffffffffg" ;
76*0Sstevel@tonic-gate    ]; print STDERR $@;
77*0Sstevel@tonic-gate    my $a = oct "0xfffffffffffffffffg" ;
78*0Sstevel@tonic-gate}
79*0Sstevel@tonic-gateEXPECT
80*0Sstevel@tonic-gateInteger overflow in hexadecimal number at (eval 1) line 3.
81*0Sstevel@tonic-gateIllegal hexadecimal digit 'g' ignored at (eval 1) line 3.
82*0Sstevel@tonic-gateHexadecimal number > 0xffffffff non-portable at (eval 1) line 3.
83*0Sstevel@tonic-gate########
84*0Sstevel@tonic-gate
85*0Sstevel@tonic-gate# Check scope of pragma with eval
86*0Sstevel@tonic-gateno warnings;
87*0Sstevel@tonic-gate{
88*0Sstevel@tonic-gate    use warnings ;
89*0Sstevel@tonic-gate    eval '
90*0Sstevel@tonic-gate	my $a = oct "0xfffffffffffffffffg" ;
91*0Sstevel@tonic-gate    '; print STDERR $@ ;
92*0Sstevel@tonic-gate}
93*0Sstevel@tonic-gateEXPECT
94*0Sstevel@tonic-gateInteger overflow in hexadecimal number at (eval 1) line 2.
95*0Sstevel@tonic-gateIllegal hexadecimal digit 'g' ignored at (eval 1) line 2.
96*0Sstevel@tonic-gateHexadecimal number > 0xffffffff non-portable at (eval 1) line 2.
97*0Sstevel@tonic-gate########
98*0Sstevel@tonic-gate
99*0Sstevel@tonic-gate# Check scope of pragma with eval
100*0Sstevel@tonic-gateno warnings;
101*0Sstevel@tonic-gate{
102*0Sstevel@tonic-gate    use warnings;
103*0Sstevel@tonic-gate    eval '
104*0Sstevel@tonic-gate        no warnings ;
105*0Sstevel@tonic-gate	my $a = oct "0xfffffffffffffffffg" ;
106*0Sstevel@tonic-gate    '; print STDERR $@ ;
107*0Sstevel@tonic-gate}
108*0Sstevel@tonic-gateEXPECT
109*0Sstevel@tonic-gate
110*0Sstevel@tonic-gate########
111*0Sstevel@tonic-gate
112*0Sstevel@tonic-gate# Check scope of pragma with eval
113*0Sstevel@tonic-gateno warnings;
114*0Sstevel@tonic-gate{
115*0Sstevel@tonic-gate    use warnings 'deprecated' ;
116*0Sstevel@tonic-gate    eval '
117*0Sstevel@tonic-gate	my $a = oct "0xfffffffffffffffffg" ;
118*0Sstevel@tonic-gate    '; print STDERR $@;
119*0Sstevel@tonic-gate}
120*0Sstevel@tonic-gateEXPECT
121*0Sstevel@tonic-gate
122