Commit | Line | Data |
599cee73 |
1 | util.c AOK |
2 | |
3 | Illegal octal digit ignored |
4 | my $a = oct "029" ; |
5 | |
9e24b6e2 |
6 | Illegal hex digit ignored |
599cee73 |
7 | my $a = hex "0xv9" ; |
8 | |
4f19785b |
9 | Illegal binary digit ignored |
10 | my $a = oct "0b9" ; |
767a6a26 |
11 | |
12 | Integer overflow in binary number |
13 | my $a = oct "0b111111111111111111111111111111111111111111" ; |
14 | Binary number > 0b11111111111111111111111111111111 non-portable |
15 | $a = oct "0b111111111111111111111111111111111" ; |
16 | Integer overflow in octal number |
ccc2aad8 |
17 | my $a = oct "077777777777777777777777777777" ; |
767a6a26 |
18 | Octal number > 037777777777 non-portable |
19 | $a = oct "0047777777777" ; |
20 | Integer overflow in hexadecimal number |
21 | my $a = hex "0xffffffffffffffffffff" ; |
22 | Hexadecimal number > 0xffffffff non-portable |
23 | $a = hex "0x1ffffffff" ; |
599cee73 |
24 | |
25 | __END__ |
26 | # util.c |
4438c4b7 |
27 | use warnings 'digit' ; |
599cee73 |
28 | my $a = oct "029" ; |
4438c4b7 |
29 | no warnings 'digit' ; |
767a6a26 |
30 | $a = oct "029" ; |
599cee73 |
31 | EXPECT |
399388f4 |
32 | Illegal octal digit '9' ignored at - line 3. |
599cee73 |
33 | ######## |
34 | # util.c |
4438c4b7 |
35 | use warnings 'digit' ; |
767a6a26 |
36 | my $a = hex "0xv9" ; |
4438c4b7 |
37 | no warnings 'digit' ; |
767a6a26 |
38 | $a = hex "0xv9" ; |
599cee73 |
39 | EXPECT |
651978e7 |
40 | Illegal hexadecimal digit 'v' ignored at - line 3. |
4f19785b |
41 | ######## |
42 | # util.c |
4438c4b7 |
43 | use warnings 'digit' ; |
767a6a26 |
44 | my $a = oct "0b9" ; |
4438c4b7 |
45 | no warnings 'digit' ; |
767a6a26 |
46 | $a = oct "0b9" ; |
4f19785b |
47 | EXPECT |
399388f4 |
48 | Illegal binary digit '9' ignored at - line 3. |
767a6a26 |
49 | ######## |
50 | # util.c |
51 | use warnings 'overflow' ; |
15041a67 |
52 | my $a = oct "0b11111111111111111111111111111111111111111111111111111111111111111"; |
767a6a26 |
53 | no warnings 'overflow' ; |
15041a67 |
54 | $a = oct "0b11111111111111111111111111111111111111111111111111111111111111111"; |
767a6a26 |
55 | EXPECT |
56 | Integer overflow in binary number at - line 3. |
57 | ######## |
58 | # util.c |
59 | use warnings 'overflow' ; |
60 | my $a = hex "0xffffffffffffffffffff" ; |
61 | no warnings 'overflow' ; |
62 | $a = hex "0xffffffffffffffffffff" ; |
63 | EXPECT |
64 | Integer overflow in hexadecimal number at - line 3. |
65 | ######## |
66 | # util.c |
67 | use warnings 'overflow' ; |
ccc2aad8 |
68 | my $a = oct "077777777777777777777777777777" ; |
767a6a26 |
69 | no warnings 'overflow' ; |
ccc2aad8 |
70 | $a = oct "077777777777777777777777777777" ; |
767a6a26 |
71 | EXPECT |
72 | Integer overflow in octal number at - line 3. |
73 | ######## |
74 | # util.c |
75 | use warnings 'portable' ; |
76 | my $a = oct "0b011111111111111111111111111111110" ; |
77 | $a = oct "0b011111111111111111111111111111111" ; |
78 | $a = oct "0b111111111111111111111111111111111" ; |
79 | no warnings 'portable' ; |
80 | $a = oct "0b011111111111111111111111111111110" ; |
81 | $a = oct "0b011111111111111111111111111111111" ; |
82 | $a = oct "0b111111111111111111111111111111111" ; |
83 | EXPECT |
84 | Binary number > 0b11111111111111111111111111111111 non-portable at - line 5. |
85 | ######## |
86 | # util.c |
87 | use warnings 'portable' ; |
88 | my $a = hex "0x0fffffffe" ; |
89 | $a = hex "0x0ffffffff" ; |
90 | $a = hex "0x1ffffffff" ; |
91 | no warnings 'portable' ; |
92 | $a = hex "0x0fffffffe" ; |
93 | $a = hex "0x0ffffffff" ; |
94 | $a = hex "0x1ffffffff" ; |
95 | EXPECT |
96 | Hexadecimal number > 0xffffffff non-portable at - line 5. |
97 | ######## |
98 | # util.c |
99 | use warnings 'portable' ; |
100 | my $a = oct "0037777777776" ; |
101 | $a = oct "0037777777777" ; |
102 | $a = oct "0047777777777" ; |
103 | no warnings 'portable' ; |
104 | $a = oct "0037777777776" ; |
105 | $a = oct "0037777777777" ; |
106 | $a = oct "0047777777777" ; |
107 | EXPECT |
108 | Octal number > 037777777777 non-portable at - line 5. |