mirror of
https://github.com/curl/curl.git
synced 2026-05-01 00:57:51 +03:00
scripts: enable strict warnings in Perl where missing, fix fallouts
- add 'use warnings' and 'use strict' where missing from Perl scripts. - fix 'Use of uninitialized value'. - fix missing declarations. - test1140.pl: fix 'Possible precedence issue with control flow operator'. - fix other misc issues. Most actual errors found during this PR were fixed and merged via separate PRs. Likely there are remaining warnings not found and fixed in this PR. Closes #17877
This commit is contained in:
parent
89771d19d5
commit
2ec54556d4
45 changed files with 323 additions and 97 deletions
10
.github/scripts/badwords.pl
vendored
10
.github/scripts/badwords.pl
vendored
|
|
@ -13,7 +13,15 @@
|
|||
#
|
||||
# ---(accepted word)
|
||||
#
|
||||
my $w;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my @whitelist;
|
||||
my %alt;
|
||||
my %exactcase;
|
||||
|
||||
my @w;
|
||||
while(<STDIN>) {
|
||||
chomp;
|
||||
if($_ =~ /^#/) {
|
||||
|
|
|
|||
5
.github/scripts/cleancmd.pl
vendored
5
.github/scripts/cleancmd.pl
vendored
|
|
@ -10,6 +10,11 @@
|
|||
# might have a problem with that we still deem is fine.
|
||||
#
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my @asyms;
|
||||
|
||||
open(S, "<./docs/libcurl/symbols-in-versions")
|
||||
|| die "can't find symbols-in-versions";
|
||||
while(<S>) {
|
||||
|
|
|
|||
3
.github/scripts/cmp-config.pl
vendored
3
.github/scripts/cmp-config.pl
vendored
|
|
@ -23,6 +23,9 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $autotools = $ARGV[0];
|
||||
my $cmake = $ARGV[1];
|
||||
|
||||
|
|
|
|||
12
.github/scripts/randcurl.pl
vendored
12
.github/scripts/randcurl.pl
vendored
|
|
@ -18,6 +18,9 @@
|
|||
# directory where it runs.
|
||||
#
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $curl = "../src/curl";
|
||||
my $url = "localhost:7777"; # not listening to this
|
||||
|
||||
|
|
@ -31,6 +34,14 @@ if(!$seconds) {
|
|||
}
|
||||
print "Run $curl for $seconds seconds\n";
|
||||
|
||||
my @opt;
|
||||
my %arg;
|
||||
my %uniq;
|
||||
my %allrc;
|
||||
|
||||
my $totalargs = 0;
|
||||
my $totalcmds = 0;
|
||||
|
||||
my $counter = 0xabcdef + time();
|
||||
sub getnum {
|
||||
my ($max) = @_;
|
||||
|
|
@ -164,6 +175,7 @@ sub runconfig {
|
|||
my $o = getnum($nopts);
|
||||
my $option = $opt[$o];
|
||||
my $ar = "";
|
||||
$uniq{$option} = 0 if(!exists $uniq{$option});
|
||||
$uniq{$option}++;
|
||||
if($arg{$option}) {
|
||||
$ar = " ".randarg();
|
||||
|
|
|
|||
5
.github/scripts/trimmarkdownheader.pl
vendored
5
.github/scripts/trimmarkdownheader.pl
vendored
|
|
@ -7,7 +7,10 @@
|
|||
# Outputs: the same file, minus the header
|
||||
#
|
||||
|
||||
my $f = $ARGV[0];
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $f = $ARGV[0] || '';
|
||||
|
||||
open(F, "<$f") or die;
|
||||
|
||||
|
|
|
|||
9
.github/scripts/verify-examples.pl
vendored
9
.github/scripts/verify-examples.pl
vendored
|
|
@ -23,12 +23,15 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my @files = @ARGV;
|
||||
my $cfile = "test.c";
|
||||
my $check = "./scripts/checksrc.pl";
|
||||
my $error;
|
||||
my $error = 0;
|
||||
|
||||
if($files[0] eq "-h") {
|
||||
if(!@files || $files[0] eq "-h") {
|
||||
print "Usage: verify-examples [markdown pages]\n";
|
||||
exit;
|
||||
}
|
||||
|
|
@ -82,7 +85,7 @@ sub extract {
|
|||
return ($fail ? 0 : $l);
|
||||
}
|
||||
|
||||
my $count;
|
||||
my $count = 0;
|
||||
for my $m (@files) {
|
||||
#print "Verify $m\n";
|
||||
my $out = extract($m);
|
||||
|
|
|
|||
5
.github/scripts/verify-synopsis.pl
vendored
5
.github/scripts/verify-synopsis.pl
vendored
|
|
@ -23,10 +23,13 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my @files = @ARGV;
|
||||
my $cfile = "test.c";
|
||||
|
||||
if($files[0] eq "-h") {
|
||||
if(!@files || $files[0] eq "-h") {
|
||||
print "Usage: verify-synopsis [man pages]\n";
|
||||
exit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue