From fbca901d396dad197dd254ea8d9344d020f704d6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 11 Jul 2025 14:58:31 +0200 Subject: [PATCH] singleuse.pl: enable warnings, fix them --- scripts/singleuse.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/singleuse.pl b/scripts/singleuse.pl index 0251594b12..6156496019 100755 --- a/scripts/singleuse.pl +++ b/scripts/singleuse.pl @@ -33,13 +33,16 @@ # --unit : built to support unit tests # +use strict; +use warnings; + my $unittests; -if($ARGV[0] eq "--unit") { +if(@ARGV && $ARGV[0] eq "--unit") { $unittests = "tests/unit "; shift @ARGV; } -my $file = $ARGV[0]; +my $file = $ARGV[0] || ''; my %wl = ( 'Curl_xfer_write_resp' => 'internal api', @@ -178,7 +181,6 @@ open(N, "nm $file|") || my %exist; my %uses; -my $file; while() { my $l = $_; chomp $l; @@ -204,7 +206,7 @@ while() { } close(N); -my $err; +my $err = 0; for(sort keys %exist) { #printf "%s is defined in %s, used by: %s\n", $_, $exist{$_}, $uses{$_}; if(!$uses{$_}) {