summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorAndrew Dunstan2020-04-13 15:55:45 +0000
committerAndrew Dunstan2020-04-13 15:55:45 +0000
commit7be5d8df1f74b78620167d3abf32ee607e728919 (patch)
tree030ea8b9fe1360b7670277c0af44e028de652497 /src/tools
parent8930e43ecd3f683c457865131d7a932401a2188f (diff)
Use perl warnings pragma consistently
We've had a mixture of the warnings pragma, the -w switch on the shebang line, and no warnings at all. This patch removes the -w swicth and add the warnings pragma to all perl sources missing it. It raises the severity of the TestingAndDebugging::RequireUseWarnings perlcritic policy to level 5, so that we catch any future violations. Discussion: https://postgr.es/m/20200412074245.GB623763@rfd.leadboat.com
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/fix-old-flex-code.pl2
-rw-r--r--src/tools/msvc/build.pl1
-rw-r--r--src/tools/msvc/pgbison.pl2
-rw-r--r--src/tools/msvc/pgflex.pl2
-rw-r--r--src/tools/msvc/vcregress.pl1
-rw-r--r--src/tools/perlcheck/perlcriticrc4
-rwxr-xr-xsrc/tools/pginclude/pgcheckdefines3
-rwxr-xr-xsrc/tools/version_stamp.pl3
8 files changed, 15 insertions, 3 deletions
diff --git a/src/tools/fix-old-flex-code.pl b/src/tools/fix-old-flex-code.pl
index 2954cf5a726..1bbb7cdb841 100644
--- a/src/tools/fix-old-flex-code.pl
+++ b/src/tools/fix-old-flex-code.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#----------------------------------------------------------------------
#
# fix-old-flex-code.pl
diff --git a/src/tools/msvc/build.pl b/src/tools/msvc/build.pl
index 2e47f24783f..3c886fcd499 100644
--- a/src/tools/msvc/build.pl
+++ b/src/tools/msvc/build.pl
@@ -3,6 +3,7 @@
# src/tools/msvc/build.pl
use strict;
+use warnings;
use File::Basename;
use File::Spec;
diff --git a/src/tools/msvc/pgbison.pl b/src/tools/msvc/pgbison.pl
index 490df833673..774d5be0595 100644
--- a/src/tools/msvc/pgbison.pl
+++ b/src/tools/msvc/pgbison.pl
@@ -3,6 +3,8 @@
# src/tools/msvc/pgbison.pl
use strict;
+use warnings;
+
use File::Basename;
# assume we are in the postgres source root
diff --git a/src/tools/msvc/pgflex.pl b/src/tools/msvc/pgflex.pl
index aceed5ffd6c..26c73dbfade 100644
--- a/src/tools/msvc/pgflex.pl
+++ b/src/tools/msvc/pgflex.pl
@@ -3,6 +3,8 @@
# src/tools/msvc/pgflex.pl
use strict;
+use warnings;
+
use File::Basename;
# silence flex bleatings about file path style
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 82dca29a616..c39178a93ca 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -3,6 +3,7 @@
# src/tools/msvc/vcregress.pl
use strict;
+use warnings;
our $config;
diff --git a/src/tools/perlcheck/perlcriticrc b/src/tools/perlcheck/perlcriticrc
index bd848a9a653..314c83c6a59 100644
--- a/src/tools/perlcheck/perlcriticrc
+++ b/src/tools/perlcheck/perlcriticrc
@@ -19,6 +19,10 @@ verbose = %f: %m at line %l, column %c. %e. ([%p] Severity: %s)\n
# allow octal constants with leading zeros
[-ValuesAndExpressions::ProhibitLeadingZeros]
+# insist on use of the warnings pragma
+[TestingAndDebugging::RequireUseWarnings]
+severity = 5
+
# for now raise severity of this to level 5
[Subroutines::RequireFinalReturn]
severity = 5
diff --git a/src/tools/pginclude/pgcheckdefines b/src/tools/pginclude/pgcheckdefines
index 4edf7fc56e8..0a760d6ecad 100755
--- a/src/tools/pginclude/pgcheckdefines
+++ b/src/tools/pginclude/pgcheckdefines
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -w
+#! /usr/bin/perl
#
# This script looks for symbols that are referenced in #ifdef or defined()
@@ -21,6 +21,7 @@
#
use strict;
+use warnings;
use Cwd;
use File::Basename;
diff --git a/src/tools/version_stamp.pl b/src/tools/version_stamp.pl
index cb59ad234ab..fcd3f180487 100755
--- a/src/tools/version_stamp.pl
+++ b/src/tools/version_stamp.pl
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -w
+#! /usr/bin/perl
#################################################################
# version_stamp.pl -- update version stamps throughout the source tree
@@ -21,6 +21,7 @@
#
use strict;
+use warnings;
# Major version is hard-wired into the script. We update it when we branch
# a new development version.