Skip to content

Commit c538592

Browse files
committed
Make all Perl warnings fatal
There are a lot of Perl scripts in the tree, mostly code generation and TAP tests. Occasionally, these scripts produce warnings. These are probably always mistakes on the developer side (true positives). Typical examples are warnings from genbki.pl or related when you make a mess in the catalog files during development, or warnings from tests when they massage a config file that looks different on different hosts, or mistakes during merges (e.g., duplicate subroutine definitions), or just mistakes that weren't noticed because there is a lot of output in a verbose build. This changes all warnings into fatal errors, by replacing use warnings; by use warnings FATAL => 'all'; in all Perl files. Discussion: https://www.postgresql.org/message-id/flat/06f899fd-1826-05ab-42d6-adeb1fd5e200%40eisentraut.org
1 parent 7418767 commit c538592

File tree

278 files changed

+282
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+282
-280
lines changed

config/check_modules.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# but specify them anyway for documentation's sake.)
66
#
77
use strict;
8-
use warnings;
8+
use warnings FATAL => 'all';
99
use Config;
1010

1111
use IPC::Run 0.79;

contrib/amcheck/t/001_verify_heapam.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
33

44
use strict;
5-
use warnings;
5+
use warnings FATAL => 'all';
66

77
use PostgreSQL::Test::Cluster;
88
use PostgreSQL::Test::Utils;

contrib/amcheck/t/002_cic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Test CREATE INDEX CONCURRENTLY with concurrent modifications
55
use strict;
6-
use warnings;
6+
use warnings FATAL => 'all';
77

88
use PostgreSQL::Test::Cluster;
99
use PostgreSQL::Test::Utils;

contrib/amcheck/t/003_cic_2pc.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Test CREATE INDEX CONCURRENTLY with concurrent prepared-xact modifications
55
use strict;
6-
use warnings;
6+
use warnings FATAL => 'all';
77

88
use PostgreSQL::Test::Cluster;
99
use PostgreSQL::Test::Utils;

contrib/amcheck/t/004_verify_nbtree_unique.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# presence of breaking sort order changes.
66
#
77
use strict;
8-
use warnings;
8+
use warnings FATAL => 'all';
99
use PostgreSQL::Test::Cluster;
1010
use PostgreSQL::Test::Utils;
1111
use Test::More;

contrib/amcheck/t/005_pitr.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Test integrity of intermediate states by PITR to those states
44
use strict;
5-
use warnings;
5+
use warnings FATAL => 'all';
66
use PostgreSQL::Test::Cluster;
77
use PostgreSQL::Test::Utils;
88
use Test::More;

contrib/auto_explain/t/001_auto_explain.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
33

44
use strict;
5-
use warnings;
5+
use warnings FATAL => 'all';
66

77
use PostgreSQL::Test::Cluster;
88
use PostgreSQL::Test::Utils;

contrib/basebackup_to_shell/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
22

33
use strict;
4-
use warnings;
4+
use warnings FATAL => 'all';
55

66
use PostgreSQL::Test::Cluster;
77
use PostgreSQL::Test::Utils;

contrib/bloom/t/001_wal.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Test generic xlog record work for bloom index replication.
55
use strict;
6-
use warnings;
6+
use warnings FATAL => 'all';
77
use PostgreSQL::Test::Cluster;
88
use PostgreSQL::Test::Utils;
99
use Test::More;

contrib/fuzzystrmatch/daitch_mokotoff_header.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010

1111
use strict;
12-
use warnings;
12+
use warnings FATAL => 'all';
1313

1414
die "Usage: $0 OUTPUT_FILE\n" if @ARGV != 1;
1515
my $output_file = $ARGV[0];

contrib/intarray/bench/bench.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
44

55
use strict;
6-
use warnings;
6+
use warnings FATAL => 'all';
77

88
# make sure we are in a sane environment.
99
use DBI();

contrib/intarray/bench/create_test.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# contrib/intarray/bench/create_test.pl
66

77
use strict;
8-
use warnings;
8+
use warnings FATAL => 'all';
99

1010
print <<EOT;
1111
create table message (

contrib/oid2name/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
33

44
use strict;
5-
use warnings;
5+
use warnings FATAL => 'all';
66

77
use PostgreSQL::Test::Utils;
88
use Test::More;

contrib/pg_prewarm/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
33

44
use strict;
5-
use warnings;
5+
use warnings FATAL => 'all';
66

77
use PostgreSQL::Test::Cluster;
88
use PostgreSQL::Test::Utils;

contrib/seg/seg-validate.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
44

55
use strict;
6-
use warnings;
6+
use warnings FATAL => 'all';
77

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

contrib/seg/sort-segments.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# this script will sort any table with the segment data type in its last column
66

77
use strict;
8-
use warnings;
8+
use warnings FATAL => 'all';
99

1010
my @rows;
1111

contrib/test_decoding/t/001_repl_stats.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Test replication statistics data in pg_stat_replication_slots is sane after
55
# drop replication slot and restart.
66
use strict;
7-
use warnings;
7+
use warnings FATAL => 'all';
88
use File::Path qw(rmtree);
99
use PostgreSQL::Test::Cluster;
1010
use PostgreSQL::Test::Utils;

contrib/vacuumlo/t/001_basic.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
33

44
use strict;
5-
use warnings;
5+
use warnings FATAL => 'all';
66

77
use PostgreSQL::Test::Utils;
88
use Test::More;

doc/src/sgml/generate-errcodes-table.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright (c) 2000-2023, PostgreSQL Global Development Group
55

66
use strict;
7-
use warnings;
7+
use warnings FATAL => 'all';
88

99
print
1010
"<!-- autogenerated from src/backend/utils/errcodes.txt, do not edit -->\n";

doc/src/sgml/generate-keywords-table.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Copyright (c) 2019-2023, PostgreSQL Global Development Group
66

77
use strict;
8-
use warnings;
8+
use warnings FATAL => 'all';
99

1010
my @sql_versions = reverse sort ('1992', '2016', '2023');
1111

doc/src/sgml/generate-targets-meson.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright (c) 2000-2023, PostgreSQL Global Development Group
55

66
use strict;
7-
use warnings;
7+
use warnings FATAL => 'all';
88

99
my $targets_meson_file = $ARGV[0];
1010
open my $targets_meson, '<', $targets_meson_file or die;

doc/src/sgml/mk_feature_tables.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# doc/src/sgml/mk_feature_tables.pl
44

55
use strict;
6-
use warnings;
6+
use warnings FATAL => 'all';
77

88
my $yesno = $ARGV[0];
99

src/backend/catalog/Catalog.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
package Catalog;
1515

1616
use strict;
17-
use warnings;
17+
use warnings FATAL => 'all';
1818

1919
use File::Compare;
2020

src/backend/catalog/genbki.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#----------------------------------------------------------------------
1515

1616
use strict;
17-
use warnings;
17+
use warnings FATAL => 'all';
1818
use Getopt::Long;
1919

2020
use FindBin;

src/backend/nodes/gen_node_support.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#----------------------------------------------------------------------
1717

1818
use strict;
19-
use warnings;
19+
use warnings FATAL => 'all';
2020

2121
use File::Basename;
2222
use Getopt::Long;

src/backend/parser/check_keywords.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (c) 2009-2023, PostgreSQL Global Development Group
88

99
use strict;
10-
use warnings;
10+
use warnings FATAL => 'all';
1111

1212
my $gram_filename = $ARGV[0];
1313
my $kwlist_filename = $ARGV[1];

src/backend/snowball/snowball_create.pl

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

33
use strict;
4-
use warnings;
4+
use warnings FATAL => 'all';
55
use Getopt::Long;
66

77
my $outdir_path = '';

src/backend/storage/lmgr/generate-lwlocknames.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright (c) 2000-2023, PostgreSQL Global Development Group
55

66
use strict;
7-
use warnings;
7+
use warnings FATAL => 'all';
88
use Getopt::Long;
99

1010
my $output_path = '.';

src/backend/utils/Gen_dummy_probes.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#-------------------------------------------------------------------------
88

99
use strict;
10-
use warnings;
10+
use warnings FATAL => 'all';
1111

1212
m/^\s*probe / || next;
1313
s/^\s*probe ([^(]*)(.*);/$1$2/;

src/backend/utils/Gen_fmgrtab.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Catalog;
1818

1919
use strict;
20-
use warnings;
20+
use warnings FATAL => 'all';
2121
use Getopt::Long;
2222

2323
my $output_path = '';

src/backend/utils/activity/generate-wait_event_types.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#----------------------------------------------------------------------
1616

1717
use strict;
18-
use warnings;
18+
use warnings FATAL => 'all';
1919
use Getopt::Long;
2020

2121
my $output_path = '.';

src/backend/utils/generate-errcodes.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright (c) 2000-2023, PostgreSQL Global Development Group
55

66
use strict;
7-
use warnings;
7+
use warnings FATAL => 'all';
88
use Getopt::Long;
99

1010
my $outfile = '';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# # and Unicode name (not used in this script)
2626

2727
use strict;
28-
use warnings;
28+
use warnings FATAL => 'all';
2929

3030
use convutils;
3131

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# and the "b" field is the hex byte sequence for GB18030
1515

1616
use strict;
17-
use warnings;
17+
use warnings FATAL => 'all';
1818

1919
use convutils;
2020

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# "euc-jis-2004-std.txt" (http://x0213.org)
99

1010
use strict;
11-
use warnings;
11+
use warnings FATAL => 'all';
1212

1313
use convutils;
1414

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# organization's ftp site.
1313

1414
use strict;
15-
use warnings;
15+
use warnings FATAL => 'all';
1616

1717
use convutils;
1818

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# # and Unicode name (not used in this script)
1818

1919
use strict;
20-
use warnings;
20+
use warnings FATAL => 'all';
2121

2222
use convutils;
2323

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# # and Unicode name (not used in this script)
1919

2020
use strict;
21-
use warnings;
21+
use warnings FATAL => 'all';
2222

2323
use convutils;
2424

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# and the "b" field is the hex byte sequence for GB18030
1515

1616
use strict;
17-
use warnings;
17+
use warnings FATAL => 'all';
1818

1919
use convutils;
2020

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# # and Unicode name (not used in this script)
1717

1818
use strict;
19-
use warnings;
19+
use warnings FATAL => 'all';
2020

2121
use convutils;
2222

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# "sjis-0213-2004-std.txt" (http://x0213.org)
99

1010
use strict;
11-
use warnings;
11+
use warnings FATAL => 'all';
1212

1313
use convutils;
1414

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# ftp site.
1212

1313
use strict;
14-
use warnings;
14+
use warnings FATAL => 'all';
1515

1616
use convutils;
1717

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# and the "b" field is the hex byte sequence for UHC
1515

1616
use strict;
17-
use warnings;
17+
use warnings FATAL => 'all';
1818

1919
use convutils;
2020

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# # and Unicode name (not used in this script)
1717

1818
use strict;
19-
use warnings;
19+
use warnings FATAL => 'all';
2020

2121
use convutils;
2222

0 commit comments

Comments
 (0)