From 317ea90d97caba0232674f77b3cbed1394243c39 Mon Sep 17 00:00:00 2001 From: "Michael G. Schwern" Date: Sat, 29 Dec 2001 18:46:25 -0500 Subject: -t without -w Message-ID: <20011230044625.GA14386@blackrider> p4raw-id: //depot/perl@13953 --- warnings.pl | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'warnings.pl') 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'; -- cgit v1.2.1