Dual-Life / Devel-PPPort

Perl/Pollution/Portability
9 stars 28 forks source link

Avoid indirect calls and enforce strict & warnings #187

Closed atoomic closed 4 years ago

atoomic commented 4 years ago

This work was performed on the p7 experimental branch and most of the changes comes from kid51.

jkeenan commented 4 years ago

This is failing tests on early perls due to the warnings issue that I commented on

Would something like this work (modulo line breaks)?

diff --git a/dist/Devel-PPPort/parts/inc/ppphtest b/dist/Devel-PPPort/parts/inc/ppphtest
index c6877afcbe..4a8b617cb2 100644
--- a/dist/Devel-PPPort/parts/inc/ppphtest
+++ b/dist/Devel-PPPort/parts/inc/ppphtest
@@ -681,7 +681,7 @@ my $fail = 0;
 for (@o) {
   my($name, $flags) = /^(\w+)(?:\s+\[(\w+(?:,\s+\w+)*)\])?$/ or $fail++;
   {
-    no warnings 'uninitialized';
+    BEGIN { 'warnings'->unimport('uninitialized') if "$]" > '5.006' }
     exists $p{$name} and $fail++;
     $p{$name} = defined $flags ? { map { ($_ => 1) } $flags =~ /(\w+)/g } : '';
   }
khwilliamson commented 4 years ago

On 7/19/20 12:09 PM, James E Keenan wrote:

This is failing tests on early perls due to the warnings issue that
I commented on

Would something like this work (modulo line breaks)?

|diff --git a/dist/Devel-PPPort/parts/inc/ppphtest b/dist/Devel-PPPort/parts/inc/ppphtest index c6877afcbe..4a8b617cb2 100644 --- a/dist/Devel-PPPort/parts/inc/ppphtest +++ b/dist/Devel-PPPort/parts/inc/ppphtest @@ -681,7 +681,7 @@ my $fail = 0; for (@o) { my($name, $flags) = /^(\w+)(?:\s+[(\w+(?:,\s+\w+)*)])?$/ or $fail++; { - no warnings 'uninitialized'; + BEGIN { 'warnings'->unimport('uninitialized') if "$]" > '5.006' } exists $p{$name} and $fail++; $p{$name} = defined $flags ? { map { ($_ => 1) } $flags =~ /(\w+)/g } : ''; } |

I need to regenerate D:P anyway, so I'll see what works:

khwilliamson commented 4 years ago

I tested this line successfully

'warnings'->unimport('uninitialized') if "$]" > '5.006';

atoomic commented 4 years ago

@khwilliamson with the last state at 68385410 this should fix 5.6

atoomic commented 4 years ago

@khwilliamson as discussed I've removed the extra unimport warnings BEGIN { 'warnings'->unimport('uninitialized') if "$]" > '5.006' } 8b9ff6d9 ready for another review