Re: Make all Perl warnings fatal
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-08-22T13:20:28Z
Lists: 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."
Commits
-
Add missing FATAL => 'all' to a use warnings in Perl
- 014720c6d9fb 18.0 landed
-
Make all Perl warnings fatal in 043_wal_replay_wait.pl
- e1555645d729 18.0 landed
-
Add tap test for pg_signal_autovacuum role
- d2b74882cab8 18.0 cited
-
Implement pg_wal_replay_wait() stored procedure
- 06c418e163e9 17.0 cited
-
Fix an issue in PostgreSQL::Test::Cluster:psql()
- 686db12de3a0 17.0 landed
-
Make all Perl warnings fatal
- c5385929593d 17.0 landed
-
Fix a warning in Perl test code
- a7ebd82b9e50 17.0 landed
-
Avoid use of Perl getprotobyname
- 01226c682ce6 17.0 landed