diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-29 00:12:52 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-29 00:12:52 +0000 |
commit | 164e0d64e76aeb41b383f338cffa7d2e2e075e7c (patch) | |
tree | b1b9bfd4778c4f60efd4f4d13ebcf82e5cbcfb7c /t/pragma/warn/util | |
parent | 3075ddba723b9b3d732695035818e7b3e7287e85 (diff) | |
parent | 2392504606465e088e5dc097fdf20f848f2b94fd (diff) | |
download | perl-164e0d64e76aeb41b383f338cffa7d2e2e075e7c.tar.gz |
integrate cfgperl changes into mainline
p4raw-id: //depot/perl@3825
Diffstat (limited to 't/pragma/warn/util')
-rw-r--r-- | t/pragma/warn/util | 55 |
1 files changed, 20 insertions, 35 deletions
diff --git a/t/pragma/warn/util b/t/pragma/warn/util index fc1e6dde3f..87d43e8ffc 100644 --- a/t/pragma/warn/util +++ b/t/pragma/warn/util @@ -3,7 +3,7 @@ Illegal octal digit ignored my $a = oct "029" ; - Illegal hex digit ignored + Illegal hexadecimal digit ignored my $a = hex "0xv9" ; Illegal binary digit ignored @@ -21,7 +21,7 @@ __END__ use warning 'octal' ; my $a = oct "029" ; no warning 'octal' ; -my $a = oct "029" ; +my $b = oct "029" ; EXPECT Illegal octal digit '9' ignored at - line 3. ######## @@ -42,62 +42,47 @@ EXPECT Illegal binary digit '9' ignored at - line 3. ######## # util.c -BEGIN { require Config ; import Config } -$^W =1 ; +$^W = 1 ; sub make_bin { "1" x $_[0] } -my $s = $Config{longsize}; -eval { pack "q", 0 }; eval { $s = length pack "q", 0 } unless $@; -$n = make_bin(8 * $s ) ; -$o = make_bin(8 * $s + 1) ; +$n = make_bin(33); { use warning 'unsafe' ; my $a = oct "0b$n" ; - my $b = oct "0b$o" ; no warning 'unsafe' ; - $b = oct "0b$o" ; + my $b = oct "0b$n" ; } -my $b = oct "0b$o" ; +my $c = oct "0b$n" ; EXPECT -Integer overflow in binary number at - line 12. -Integer overflow in binary number at - line 16. +Binary number > 0b11111111111111111111111111111111 non-portable at - line 7. +Binary number > 0b11111111111111111111111111111111 non-portable at - line 11. ######## # util.c -BEGIN { require Config ; import Config } -$^W =1 ; +$^W = 1 ; sub make_oct { ("","1","3")[$_[0]%3] . "7" x int($_[0]/3) } -my $s = $Config{longsize}; -eval { pack "q", 0 }; eval { $s = length pack "q", 0 } unless $@; -$n = make_oct(8 * $s ); -$o = make_oct(8 * $s + 1); +$n = make_oct(33); { use warning 'unsafe' ; my $a = oct "$n" ; - my $b = oct "$o" ; no warning 'unsafe' ; - $b = oct "$o" ; + my $b = oct "$n" ; } -my $b = oct "$o" ; +my $c = oct "$n" ; EXPECT -Integer overflow in octal number at - line 12. -Integer overflow in octal number at - line 16. +Octal number > 037777777777 non-portable at - line 7. +Octal number > 037777777777 non-portable at - line 11. ######## # util.c -BEGIN { require Config ; import Config } -$^W =1 ; +$^W = 1 ; sub make_hex { ("","1","3","7")[$_[0]%4] . "f" x int($_[0]/4) } -my $s = $Config{longsize}; -eval { pack "q", 0 }; eval { $s = length pack "q", 0 } unless $@; -$n = make_hex(8 * $s ) ; -$o = make_hex(8 * $s + 1) ; +$n = make_hex(33); { use warning 'unsafe' ; my $a = hex "$n" ; - my $b = hex "$o" ; no warning 'unsafe' ; - $b = hex "$o" ; + my $b = hex "$n" ; } -my $b = hex "$o" ; +my $c = hex "$n" ; EXPECT -Integer overflow in hexadecimal number at - line 12. -Integer overflow in hexadecimal number at - line 16. +Hexadecimal number > 0xffffffff non-portable at - line 7. +Hexadecimal number > 0xffffffff non-portable at - line 11. |