In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/398a990f4831b43774f3ef6405e1fa6d326d23a1?hp=a934a4a7d4fa99d522e169b921286755a0f8d248>

- Log -----------------------------------------------------------------
commit 398a990f4831b43774f3ef6405e1fa6d326d23a1
Author: David Mitchell <[email protected]>
Date:   Sun Jan 3 19:34:26 2016 +0000

    fix -DPERL_GLOBAL_STRUCT_PRIVATE builds
    
    t/porting/libperl.t checks that, under -DPERL_GLOBAL_STRUCT_PRIVATE
    builds, there are no bss symbols. This line in locale.c was failing that
    test:
    
        static char ret[128] = "";
    
    By changing it to
    
        static char ret[128] = "x";
    
    it's no longer BSS data and the test passes.
    
    Bit of a hack, but that function only exists in debugging builds, so it
    doesn't matter too much.
-----------------------------------------------------------------------

Summary of changes:
 locale.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/locale.c b/locale.c
index 53ae151..91b414e 100644
--- a/locale.c
+++ b/locale.c
@@ -1878,7 +1878,9 @@ Perl__setlocale_debug_string(const int category,        
/* category number,
      * be overwritten by the next call, so this should be used just to
      * formulate a string to immediately print or savepv() on. */
 
-    static char ret[128] = "";
+    /* initialise to a non-null value to keep it out of BSS and so keep
+     * -DPERL_GLOBAL_STRUCT_PRIVATE happy */
+    static char ret[128] = "x";
 
     my_strlcpy(ret, "setlocale(", sizeof(ret));
 

--
Perl5 Master Repository

Reply via email to