Re: Make all Perl warnings fatal

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Make all Perl warnings fatal
Дата
Msg-id 20230822132028.jea3gfvs5lhrcjcb@alvherre.pgsql
обсуждение исходный текст
Ответ на Make all Perl warnings fatal  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: Make all Perl warnings fatal  (Andrew Dunstan <andrew@dunslane.net>)
Re: Make all Perl warnings fatal  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Список pgsql-hackers
On 2023-Aug-10, Peter Eisentraut wrote:

> I wanted to figure put if we can catch these more reliably, in the style of
> -Werror.  AFAICT, there is no way to automatically turn all warnings into
> fatal errors.  But there is a way to do it per script, by replacing
> 
>     use warnings;
> 
> by
> 
>     use warnings FATAL => 'all';
> 
> See attached patch to try it out.

BTW in case we do find that there's some unforeseen problem and we want
to roll back, it would be great to have a way to disable this without
having to edit every single Perl file again later.  However, I didn't
find a way to do it -- I thought about creating a separate PgWarnings.pm
file that would do the "use warnings FATAL => 'all'" dance and which
every other Perl file would use or include; but couldn't make it work.
Maybe some Perl expert knows a good answer to this.

Maybe the BEGIN block of each file can `eval` a new PgWarnings.pm that
emits the "use warnings" line?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"No renuncies a nada. No te aferres a nada."



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Make all Perl warnings fatal
Следующее
От: Tom Lane
Дата:
Сообщение: Re: list of acknowledgments for PG16