warning handling in Perl scripts

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема warning handling in Perl scripts
Дата
Msg-id 1340563251.13589.5.camel@vanquo.pezone.net
обсуждение исходный текст
Ответы Re: warning handling in Perl scripts  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Every time I make a change to the structure of the catalog files,
genbki.pl produces a bunch of warnings (like "Use of uninitialized value
in string eq at genbki.pl line ..."), and produces corrupted output
files, that are then (possibly) detected later by the compiler.  Also,
getting out of that is difficult because due to the complicated
dependency relationship between the involved files, you need to remove a
bunch of files manually, or clean everything.  So error handling could
be better.

It seems that adding

diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl
index ebc4825..7d66da9 100644
--- a/src/backend/catalog/genbki.pl
+++ b/src/backend/catalog/genbki.pl
@@ -19,6 +19,8 @@use strict;use warnings;
+local $SIG{__WARN__} = sub { die $_[0] };
+my @input_files;our @include_path;my $output_path = '';

would address that.

Could that cause any other problems?  Should it be added to all Perl
scripts?




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Preferred way to define 64-bit constants?
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Preferred way to define 64-bit constants?