develooper Front page | perl.perl5.porters | Postings from March 2021

Can we write a test for the warning revised in commit 65c2a5af6c?

Thread Next
From:
James E Keenan
Date:
March 13, 2021 00:35
Subject:
Can we write a test for the warning revised in commit 65c2a5af6c?
Message ID:
e229ec3e-6f74-dcc9-1a97-e9a979c0ba5a@pobox.com
Neither the old warning nor the new appears to be exercised in our test 
suite.  Is it testable?

Thank you very much.
Jim Keenan

#####
commit 65c2a5af6c956eb2e6308d678d570dd4c5d8c2d8
Author:     Karl Williamson <khw@cpan.org>
AuthorDate: Thu Mar 4 18:06:19 2021 -0700
Commit:     Karl Williamson <khw@cpan.org>
CommitDate: Wed Mar 10 21:31:24 2021 -0700

     perl.h: Clarify debugging msg for locales

     I wrote this years ago, and now have discovered it was written
     assuming the consumer is more familiar with the underlying code than
     warranted.

diff --git a/perl.h b/perl.h
index a28371267a..3235ee1254 100644
--- a/perl.h
+++ b/perl.h
@@ -6972,8 +6972,8 @@ cannot have changed since the precalculation.
  #  define LOCK_LC_NUMERIC_STANDARD() 
      \
          STMT_START { 
      \
              DEBUG_Lv(PerlIO_printf(Perl_debug_log, 
      \
+++ b/perl.h
@@ -6972,8 +6972,8 @@ cannot have changed since the precalculation.
  #  define LOCK_LC_NUMERIC_STANDARD() 
      \
          STMT_START { 
      \
              DEBUG_Lv(PerlIO_printf(Perl_debug_log, 
      \
-                      "%s: %d: lock lc_numeric_standard: new 
depth=%d\n",   \
-                      __FILE__, __LINE__, PL_numeric_standard + 1)); 
     \
+                    "%s: %d: lc_numeric_standard now locked to depth 
%d\n", \
+                    __FILE__, __LINE__, PL_numeric_standard)); 
     \
              __ASSERT_(PL_numeric_standard) 
      \
              PL_numeric_standard++; 
      \
          } STMT_END
@@ -6987,8 +6987,13 @@ cannot have changed since the precalculation.
                  assert(0); 
      \
              } 
      \
              DEBUG_Lv(PerlIO_printf(Perl_debug_log, 
      \
-            "%s: %d: lc_numeric_standard decrement lock, new 
depth=%d\n",   \
-            __FILE__, __LINE__, PL_numeric_standard)); 
     \
+                                   "%s: %d: ",  __FILE__, __LINE__); 
     \
+                    if (PL_numeric_standard <= 1) 
     \
+                        PerlIO_printf(Perl_debug_log, 
     \
+                                      "lc_numeric_standard now 
unlocked\n");\
+                    else PerlIO_printf(Perl_debug_log, 
     \


$ ack -l lc_numeric_standard .
perl.h

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About