pgsql: Use perl warnings pragma consistently

Started by Andrew Dunstanabout 6 years ago4 messagescomitters
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

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: /messages/by-id/20200412074245.GB623763@rfd.leadboat.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7be5d8df1f74b78620167d3abf32ee607e728919

Modified Files
--------------
contrib/intarray/bench/bench.pl | 1 +
contrib/intarray/bench/create_test.pl | 2 ++
contrib/seg/seg-validate.pl | 1 +
contrib/seg/sort-segments.pl | 1 +
doc/src/sgml/mk_feature_tables.pl | 3 ++-
src/backend/catalog/genbki.pl | 2 +-
src/backend/utils/Gen_fmgrtab.pl | 2 +-
src/backend/utils/mb/Unicode/UCS_to_BIG5.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_GB18030.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_SJIS.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_UHC.pl | 2 ++
src/backend/utils/mb/Unicode/UCS_to_most.pl | 2 ++
src/backend/utils/mb/Unicode/convutils.pm | 1 +
src/backend/utils/sort/gen_qsort_tuple.pl | 3 ++-
src/bin/psql/create_help.pl | 3 ++-
src/interfaces/libpq/test/regress.pl | 3 ++-
src/pl/plperl/plc_perlboot.pl | 1 +
src/pl/plperl/plperl_opmask.pl | 2 +-
src/test/locale/sort-test.pl | 1 +
src/test/perl/SimpleTee.pm | 1 +
src/tools/fix-old-flex-code.pl | 2 +-
src/tools/msvc/build.pl | 1 +
src/tools/msvc/pgbison.pl | 2 ++
src/tools/msvc/pgflex.pl | 2 ++
src/tools/msvc/vcregress.pl | 1 +
src/tools/perlcheck/perlcriticrc | 4 ++++
src/tools/pginclude/pgcheckdefines | 3 ++-
src/tools/version_stamp.pl | 3 ++-
35 files changed, 59 insertions(+), 10 deletions(-)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#1)
Re: pgsql: Use perl warnings pragma consistently

Andrew Dunstan <andrew@dunslane.net> writes:

Use perl warnings pragma consistently

This seems to have broken something or other, as I now get a bunch of
warnings while building the docs:

...
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 522.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 524.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 526.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 528.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 529.
...

regards, tom lane

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: pgsql: Use perl warnings pragma consistently

On 2020-Apr-13, Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Use perl warnings pragma consistently

This seems to have broken something or other, as I now get a bunch of
warnings while building the docs:

...
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 522.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 524.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 526.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 528.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 529.

This should fix it.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachments:

defined.patchtext/x-diff; charset=us-asciiDownload+3-1
#4Andrew Dunstan
andrew@dunslane.net
In reply to: Alvaro Herrera (#3)
Re: pgsql: Use perl warnings pragma consistently

On 4/13/20 5:49 PM, Alvaro Herrera wrote:

On 2020-Apr-13, Tom Lane wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Use perl warnings pragma consistently

This seems to have broken something or other, as I now get a bunch of
warnings while building the docs:

...
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 522.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 524.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 526.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 528.
Use of uninitialized value within %feature_packages in concatenation (.) or string at ./mk_feature_tables.pl line 57, <$feat> line 529.

Oops. Well, I guess that's why warnings are a good idea :-)

This should fix it.

Right.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services