Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7be5d8d

Browse files
committed
Use perl warnings pragma consistently
We've had a mixture of the warnings pragma, the -w switch on the shebangline, and no warnings at all. This patch removes the -w swicth and addthe warnings pragma to all perl sources missing it. It raises theseverity of the TestingAndDebugging::RequireUseWarnings perlcriticpolicy to level 5, so that we catch any future violations.Discussion:https://postgr.es/m/20200412074245.GB623763@rfd.leadboat.com
1 parent8930e43 commit7be5d8d

35 files changed

+59
-10
lines changed

‎contrib/intarray/bench/bench.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/perl
22

33
use strict;
4+
use warnings;
45

56
# make sure we are in a sane environment.
67
use DBI();

‎contrib/intarray/bench/create_test.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# contrib/intarray/bench/create_test.pl
44

55
use strict;
6+
use warnings;
7+
68
print<<EOT;
79
create table message (
810
midint not null,

‎contrib/seg/seg-validate.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/perl
22

33
use strict;
4+
use warnings;
45

56
my$integer ='[+-]?[0-9]+';
67
my$real ='[+-]?[0-9]+\.[0-9]+';

‎contrib/seg/sort-segments.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# this script will sort any table with the segment data type in its last column
44

55
use strict;
6+
use warnings;
67

78
my@rows;
89

‎doc/src/sgml/mk_feature_tables.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# /usr/bin/perl -w
1+
# /usr/bin/perl
22

33
# doc/src/sgml/mk_feature_tables.pl
44

55
use strict;
6+
use warnings;
67

78
my$yesno =$ARGV[0];
89

‎src/backend/catalog/genbki.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22
#----------------------------------------------------------------------
33
#
44
# genbki.pl

‎src/backend/utils/Gen_fmgrtab.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/perl -w
1+
#! /usr/bin/perl
22
#-------------------------------------------------------------------------
33
#
44
# Gen_fmgrtab.pl

‎src/backend/utils/mb/Unicode/UCS_to_BIG5.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
# # and Unicode name (not used in this script)
2626

2727
use strict;
28+
use warnings;
29+
2830
use convutils;
2931

3032
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_BIG5.pl';

‎src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# and the "b" field is the hex byte sequence for GB18030
1515

1616
use strict;
17+
use warnings;
18+
1719
use convutils;
1820

1921
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl';

‎src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# "euc-jis-2004-std.txt" (http://x0213.org)
99

1010
use strict;
11+
use warnings;
12+
1113
use convutils;
1214

1315
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl';

‎src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# organization's ftp site.
1313

1414
use strict;
15+
use warnings;
16+
1517
use convutils;
1618

1719
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl';

‎src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# # and Unicode name (not used in this script)
1818

1919
use strict;
20+
use warnings;
21+
2022
use convutils;
2123

2224
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl';

‎src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# # and Unicode name (not used in this script)
1919

2020
use strict;
21+
use warnings;
22+
2123
use convutils;
2224

2325
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl';

‎src/backend/utils/mb/Unicode/UCS_to_GB18030.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# and the "b" field is the hex byte sequence for GB18030
1515

1616
use strict;
17+
use warnings;
18+
1719
use convutils;
1820

1921
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_GB18030.pl';

‎src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# # and Unicode name (not used in this script)
1717

1818
use strict;
19+
use warnings;
20+
1921
use convutils;
2022

2123
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl';

‎src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
# "sjis-0213-2004-std.txt" (http://x0213.org)
99

1010
use strict;
11+
use warnings;
12+
1113
use convutils;
1214

1315
# first generate UTF-8 --> SHIFT_JIS_2004 table

‎src/backend/utils/mb/Unicode/UCS_to_SJIS.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# ftp site.
1212

1313
use strict;
14+
use warnings;
15+
1416
use convutils;
1517

1618
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_SJIS.pl';

‎src/backend/utils/mb/Unicode/UCS_to_UHC.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
# and the "b" field is the hex byte sequence for UHC
1515

1616
use strict;
17+
use warnings;
18+
1719
use convutils;
1820

1921
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_UHC.pl';

‎src/backend/utils/mb/Unicode/UCS_to_most.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# # and Unicode name (not used in this script)
1717

1818
use strict;
19+
use warnings;
20+
1921
use convutils;
2022

2123
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_most.pl';

‎src/backend/utils/mb/Unicode/convutils.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
packageconvutils;
77

88
use strict;
9+
use warnings;
910

1011
use Carp;
1112
use Exporter'import';

‎src/backend/utils/sort/gen_qsort_tuple.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22

33
#
44
# gen_qsort_tuple.pl
@@ -26,6 +26,7 @@
2626
#
2727

2828
use strict;
29+
use warnings;
2930

3031
my$SUFFIX;
3132
my$EXTRAARGS;

‎src/bin/psql/create_help.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/perl -w
1+
#! /usr/bin/perl
22

33
#################################################################
44
# create_help.pl -- converts SGML docs to internal psql help
@@ -20,6 +20,7 @@
2020
#
2121

2222
use strict;
23+
use warnings;
2324

2425
my$docdir =$ARGV[0]ordie"$0: missing required argument: docdir\n";
2526
my$hfile =$ARGV[1] .'.h'

‎src/interfaces/libpq/test/regress.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22

33
use strict;
4+
use warnings;
45

56
# use of SRCDIR/SUBDIR is required for supporting VPath builds
67
my$srcdir =$ENV{'SRCDIR'}ordie'SRCDIR environment variable is not set';

‎src/pl/plperl/plc_perlboot.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# src/pl/plperl/plc_perlboot.pl
22

33
use strict;
4+
use warnings;
45

56
use 5.008001;
67
use varsqw(%_SHARED $_TD);

‎src/pl/plperl/plperl_opmask.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!perl -w
1+
#!perl
22

33
use strict;
44
use warnings;

‎src/test/locale/sort-test.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /usr/bin/perl
22

33
use strict;
4+
use warnings;
45
use locale;
56

67
open(my$in_fh,'<',$ARGV[0]) ||die;

‎src/test/perl/SimpleTee.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
packageSimpleTee;
1111
use strict;
12+
use warnings;
1213

1314
subTIEHANDLE
1415
{

‎src/tools/fix-old-flex-code.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/perl -w
1+
#!/usr/bin/perl
22
#----------------------------------------------------------------------
33
#
44
# fix-old-flex-code.pl

‎src/tools/msvc/build.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# src/tools/msvc/build.pl
44

55
use strict;
6+
use warnings;
67

78
use File::Basename;
89
use File::Spec;

‎src/tools/msvc/pgbison.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# src/tools/msvc/pgbison.pl
44

55
use strict;
6+
use warnings;
7+
68
use File::Basename;
79

810
# assume we are in the postgres source root

‎src/tools/msvc/pgflex.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# src/tools/msvc/pgflex.pl
44

55
use strict;
6+
use warnings;
7+
68
use File::Basename;
79

810
# silence flex bleatings about file path style

‎src/tools/msvc/vcregress.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# src/tools/msvc/vcregress.pl
44

55
use strict;
6+
use warnings;
67

78
our$config;
89

‎src/tools/perlcheck/perlcriticrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ verbose = %f: %m at line %l, column %c. %e. ([%p] Severity: %s)\n
1919
# allow octal constants with leading zeros
2020
[-ValuesAndExpressions::ProhibitLeadingZeros]
2121

22+
# insist on use of the warnings pragma
23+
[TestingAndDebugging::RequireUseWarnings]
24+
severity = 5
25+
2226
# for now raise severity of this to level 5
2327
[Subroutines::RequireFinalReturn]
2428
severity = 5

‎src/tools/pginclude/pgcheckdefines

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/perl -w
1+
#! /usr/bin/perl
22

33
#
44
# This script looks for symbols that are referenced in #ifdef or defined()
@@ -21,6 +21,7 @@
2121
#
2222

2323
use strict;
24+
use warnings;
2425

2526
use Cwd;
2627
use File::Basename;

‎src/tools/version_stamp.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/perl -w
1+
#! /usr/bin/perl
22

33
#################################################################
44
# version_stamp.pl -- update version stamps throughout the source tree
@@ -21,6 +21,7 @@
2121
#
2222

2323
use strict;
24+
use warnings;
2425

2526
# Major version is hard-wired into the script. We update it when we branch
2627
# a new development version.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp