summaryrefslogtreecommitdiff
path: root/warnings.pl
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-12-29 18:46:25 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-12-30 15:57:25 +0000
commit317ea90d97caba0232674f77b3cbed1394243c39 (patch)
tree7759cdc2fb7ce9d3937aac6424fdd1da46ac68c1 /warnings.pl
parentd17aa069f1b4912cd5ee512e17998985c6151513 (diff)
downloadperl-317ea90d97caba0232674f77b3cbed1394243c39.tar.gz
-t without -w
Message-ID: <20011230044625.GA14386@blackrider> p4raw-id: //depot/perl@13953
Diffstat (limited to 'warnings.pl')
-rw-r--r--warnings.pl28
1 files changed, 23 insertions, 5 deletions
diff --git a/warnings.pl b/warnings.pl
index 59033486f2..e317b0a48e 100644
--- a/warnings.pl
+++ b/warnings.pl
@@ -143,9 +143,9 @@ sub printTree
###########################################################################
-sub mkHex
+sub mkHexOct
{
- my ($max, @a) = @_ ;
+ my ($f, $max, @a) = @_ ;
my $mask = "\x00" x $max ;
my $string = "" ;
@@ -153,14 +153,29 @@ sub mkHex
vec($mask, $_, 1) = 1 ;
}
- #$string = unpack("H$max", $mask) ;
- #$string =~ s/(..)/\x$1/g;
foreach (unpack("C*", $mask)) {
- $string .= '\x' . sprintf("%2.2x", $_) ;
+ if ($f eq 'x') {
+ $string .= '\x' . sprintf("%2.2x", $_)
+ }
+ else {
+ $string .= '\\' . sprintf("%o", $_)
+ }
}
return $string ;
}
+sub mkHex
+{
+ my($max, @a) = @_;
+ return mkHexOct("x", $max, @a);
+}
+
+sub mkOct
+{
+ my($max, @a) = @_;
+ return mkHexOct("o", $max, @a);
+}
+
###########################################################################
if (@ARGV && $ARGV[0] eq "tree")
@@ -222,6 +237,9 @@ print WARN tab(5, '#define WARNsize'), "$warn_size\n" ;
#print WARN tab(5, '#define WARN_ALLstring'), '"', ('\377' x $warn_size) , "\"\n" ;
print WARN tab(5, '#define WARN_ALLstring'), '"', ('\125' x $warn_size) , "\"\n" ;
print WARN tab(5, '#define WARN_NONEstring'), '"', ('\0' x $warn_size) , "\"\n" ;
+my $WARN_TAINTstring = mkOct($warn_size, map $_ * 2, @{ $list{'taint'} });
+
+print WARN tab(5, '#define WARN_TAINTstring'), qq["$WARN_TAINTstring"\n] ;
print WARN <<'EOM';