Commit | Line | Data |
599cee73 |
1 | pp.c TODO |
2 | |
3 | substr outside of string |
e476b1b5 |
4 | $a = "ab" ; $b = substr($a, 4,5) ; |
599cee73 |
5 | |
6 | Attempt to use reference as lvalue in substr |
7 | $a = "ab" ; $b = \$a ; substr($b, 1,1) = $b |
8 | |
9 | uninitialized in pp_rv2gv() |
10 | my *b = *{ undef()} |
11 | |
12 | uninitialized in pp_rv2sv() |
13 | my $a = undef ; my $b = $$a |
14 | |
15 | Odd number of elements in hash list |
16 | my $a = { 1,2,3 } ; |
17 | |
18 | Invalid type in unpack: '%c |
19 | my $A = pack ("A,A", 1,2) ; |
20 | my @A = unpack ("A,A", "22") ; |
21 | |
22 | Attempt to pack pointer to temporary value |
23 | pack("p", "abc") ; |
24 | |
25 | Explicit blessing to '' (assuming package main) |
26 | bless \[], ""; |
27 | |
0453d815 |
28 | Constant subroutine %s undefined <<<TODO |
29 | Constant subroutine (anonymous) undefined <<<TODO |
30 | |
599cee73 |
31 | __END__ |
32 | # pp.c |
4438c4b7 |
33 | use warnings 'substr' ; |
599cee73 |
34 | $a = "ab" ; |
e476b1b5 |
35 | $b = substr($a, 4,5) ; |
4438c4b7 |
36 | no warnings 'substr' ; |
0453d815 |
37 | $a = "ab" ; |
e476b1b5 |
38 | $b = substr($a, 4,5) ; |
599cee73 |
39 | EXPECT |
40 | substr outside of string at - line 4. |
41 | ######## |
42 | # pp.c |
4438c4b7 |
43 | use warnings 'substr' ; |
599cee73 |
44 | $a = "ab" ; |
45 | $b = \$a ; |
46 | substr($b, 1,1) = "ab" ; |
4438c4b7 |
47 | no warnings 'substr' ; |
0453d815 |
48 | substr($b, 1,1) = "ab" ; |
599cee73 |
49 | EXPECT |
50 | Attempt to use reference as lvalue in substr at - line 5. |
51 | ######## |
52 | # pp.c |
4438c4b7 |
53 | use warnings 'uninitialized' ; |
599cee73 |
54 | # TODO |
55 | EXPECT |
56 | |
57 | ######## |
58 | # pp.c |
e476b1b5 |
59 | use warnings 'misc' ; |
599cee73 |
60 | my $a = { 1,2,3}; |
e476b1b5 |
61 | no warnings 'misc' ; |
0453d815 |
62 | my $b = { 1,2,3}; |
599cee73 |
63 | EXPECT |
64 | Odd number of elements in hash assignment at - line 3. |
65 | ######## |
66 | # pp.c |
e476b1b5 |
67 | use warnings 'pack' ; |
68 | use warnings 'unpack' ; |
599cee73 |
69 | my @a = unpack ("A,A", "22") ; |
70 | my $a = pack ("A,A", 1,2) ; |
e476b1b5 |
71 | no warnings 'pack' ; |
72 | no warnings 'unpack' ; |
0453d815 |
73 | my @b = unpack ("A,A", "22") ; |
74 | my $b = pack ("A,A", 1,2) ; |
599cee73 |
75 | EXPECT |
e476b1b5 |
76 | Invalid type in unpack: ',' at - line 4. |
77 | Invalid type in pack: ',' at - line 5. |
599cee73 |
78 | ######## |
79 | # pp.c |
4438c4b7 |
80 | use warnings 'uninitialized' ; |
599cee73 |
81 | my $a = undef ; |
0453d815 |
82 | my $b = $$a; |
4438c4b7 |
83 | no warnings 'uninitialized' ; |
0453d815 |
84 | my $c = $$a; |
599cee73 |
85 | EXPECT |
b89fed5f |
86 | Use of uninitialized value in scalar dereference at - line 4. |
599cee73 |
87 | ######## |
88 | # pp.c |
e476b1b5 |
89 | use warnings 'pack' ; |
599cee73 |
90 | sub foo { my $a = "a"; return $a . $a++ . $a++ } |
91 | my $a = pack("p", &foo) ; |
e476b1b5 |
92 | no warnings 'pack' ; |
0453d815 |
93 | my $b = pack("p", &foo) ; |
599cee73 |
94 | EXPECT |
95 | Attempt to pack pointer to temporary value at - line 4. |
96 | ######## |
97 | # pp.c |
e476b1b5 |
98 | use warnings 'misc' ; |
599cee73 |
99 | bless \[], "" ; |
e476b1b5 |
100 | no warnings 'misc' ; |
0453d815 |
101 | bless \[], "" ; |
599cee73 |
102 | EXPECT |
103 | Explicit blessing to '' (assuming package main) at - line 3. |
0453d815 |
104 | ######## |
105 | # pp.c |
106 | use utf8 ; |
107 | $_ = "\x80 \xff" ; |
108 | reverse ; |
109 | EXPECT |
0453d815 |
110 | ######## |
ac7cd81a |
111 | # pp.c |
112 | use warnings 'pack' ; |
113 | print unpack("C", pack("C", -1)), "\n"; |
114 | print unpack("C", pack("C", 0)), "\n"; |
115 | print unpack("C", pack("C", 255)), "\n"; |
116 | print unpack("C", pack("C", 256)), "\n"; |
117 | print unpack("c", pack("c", -129)), "\n"; |
118 | print unpack("c", pack("c", -128)), "\n"; |
119 | print unpack("c", pack("c", 127)), "\n"; |
120 | print unpack("c", pack("c", 128)), "\n"; |
121 | no warnings 'pack' ; |
122 | print unpack("C", pack("C", -1)), "\n"; |
123 | print unpack("C", pack("C", 0)), "\n"; |
124 | print unpack("C", pack("C", 255)), "\n"; |
125 | print unpack("C", pack("C", 256)), "\n"; |
126 | print unpack("c", pack("c", -129)), "\n"; |
127 | print unpack("c", pack("c", -128)), "\n"; |
128 | print unpack("c", pack("c", 127)), "\n"; |
129 | print unpack("c", pack("c", 128)), "\n"; |
130 | EXPECT |
131 | Character in "C" format wrapped at - line 3. |
132 | Character in "C" format wrapped at - line 6. |
133 | Character in "c" format wrapped at - line 7. |
134 | Character in "c" format wrapped at - line 10. |
135 | 255 |
136 | 0 |
137 | 255 |
138 | 0 |
139 | 127 |
140 | -128 |
141 | 127 |
142 | -128 |
143 | 255 |
144 | 0 |
145 | 255 |
146 | 0 |
147 | 127 |
148 | -128 |
149 | 127 |
150 | -128 |