Skip to contentSkip to conversation

checkstack: fix perl warnings

PATCH In review Stephen Hemminger 1 participant 1 message Jan 14, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20080114111602.591fe1a4@deepthought

#1 lore raw

PATCH 2/2 checkstack: fix perl warnings

If you enable perl warnings on this script, it shows a couple of problems:

Parentheses missing around "my" list at scripts/checkstack.pl line 105. Useless use of a variable in void context at scripts/checkstack.pl line 105. Use of uninitialized value in string eq at scripts/checkstack.pl line 33.

scripts/checkstack.pl +3 -2
@@ -30,7 +30,7 @@
 my (@stack, $re, $x, $xs);
 {
 	my $arch = shift;
-	if ($arch eq "") {
+	if (! defined $arch) {
 		$arch = `uname -m`;
 		chomp $arch;
 	}
@@ -102,7 +102,8 @@ sub bysize($) {
 #
 my $funcre = qr/^$x* <(.*)>:$/;
 my $func;
-my $file, $lastslash;
+my $file;
+my $lastslash;
 
 while (my $line = <STDIN>) {
 	if ($line =~ m/$funcre/) {