diff options
author | David Mitchell <davem@iabyn.com> | 2017-03-17 14:10:59 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-03-17 14:10:59 +0000 |
commit | 7e337d2de5bfdccdeeb8d3f2f24f559ff905770a (patch) | |
tree | af799a8c04c6ad1a49b13cd37e0377a801e7d5d8 | |
parent | 511e4ff70ef6e05671303d4eb487d4d5690dd80a (diff) | |
parent | 521aa9ac9d163b537d772e3e0de4add0df35ca80 (diff) | |
download | perl-7e337d2de5bfdccdeeb8d3f2f24f559ff905770a.tar.gz |
[MERGE] fix -DPERL_GLOBAL_STRUCT_PRIVATE builds
With no automatic smoking, this build option has suffered some bitrot over
the last few months.
-rw-r--r-- | dump.c | 2 | ||||
-rw-r--r-- | globvar.sym | 1 | ||||
-rw-r--r-- | perl.h | 6 | ||||
-rw-r--r-- | pp_hot.c | 2 | ||||
-rw-r--r-- | scope.c | 2 | ||||
-rw-r--r-- | t/porting/libperl.t | 15 | ||||
-rw-r--r-- | universal.c | 7 |
7 files changed, 23 insertions, 12 deletions
@@ -930,7 +930,7 @@ const struct flag_to_name op_flags_names[] = { /* indexed by enum OPclass */ -const char * op_class_names[] = { +const char * const op_class_names[] = { "NULL", "OP", "UNOP", diff --git a/globvar.sym b/globvar.sym index 2943fc6691..c82dc8f1c8 100644 --- a/globvar.sym +++ b/globvar.sym @@ -19,6 +19,7 @@ PL_hexdigit PL_inf PL_interp_size PL_interp_size_5_18_0 +PL_isa_DOES PL_keyword_plugin PL_latin1_lc PL_magic_data @@ -4799,6 +4799,12 @@ EXTCONST U8 PL_subversion EXTCONST char PL_uuemap[65] INIT("`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"); +/* a special string address whose value is "isa", but which perl knows + * to treat as if it were really "DOES" when printing the method name in + * the "Can't call method '%s'" error message */ +EXTCONST char PL_isa_DOES[] + INIT("isa"); + #ifdef DOINIT EXTCONST char PL_uudmap[256] = # ifdef PERL_MICRO @@ -4391,8 +4391,6 @@ Perl_vivify_ref(pTHX_ SV *sv, U32 to_what) return sv; } -extern char PL_isa_DOES[]; - PERL_STATIC_INLINE HV * S_opmethod_stash(pTHX_ SV* meth) { @@ -788,7 +788,7 @@ Perl_save_alloc(pTHX_ I32 size, I32 pad) } -static U8 arg_counts[] = { +static const U8 arg_counts[] = { 0, /* SAVEt_ALLOC */ 0, /* SAVEt_CLEARPADRANGE */ 0, /* SAVEt_CLEARSV */ diff --git a/t/porting/libperl.t b/t/porting/libperl.t index 8c1350f68c..1536fda944 100644 --- a/t/porting/libperl.t +++ b/t/porting/libperl.t @@ -359,8 +359,19 @@ if ($GSP) { ok(! exists $symbols{data}{data} || # clang with ASAN seems to add this symbol to every object file: !grep($_ ne '__unnamed_1', keys %{$symbols{data}{data}}), - "has no data data symbols"); - ok(! exists $symbols{data}{common}, "has no data common symbols"); + "has no data data symbols") + or do { + my $bad = "DATA entries (there are supposed to be none):\n"; + $bad .= " data sym: $_\n" for sort keys %{$symbols{data}{data}}; + diag($bad); + }; + + ok(! exists $symbols{data}{common}, "has no data common symbols") + or do { + my $bad = "COMMON entries (there are supposed to be none):\n"; + $bad .= " common sym: $_\n" for sort keys %{$symbols{data}{common}}; + diag($bad); + }; # -DPERL_GLOBAL_STRUCT_PRIVATE should NOT have # the extra text symbol for accessing the vars diff --git a/universal.c b/universal.c index 88835f9d78..be39310da7 100644 --- a/universal.c +++ b/universal.c @@ -184,11 +184,6 @@ The SV can be a Perl object or the name of a Perl class. #include "XSUB.h" -/* a special string address whose value is "isa", but which perl knows - * to treat as if it were really "DOES" when printing the method name in - * the "Can't call method '%s'" error message */ -char PL_isa_DOES[] = "isa"; - bool Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) { @@ -232,7 +227,7 @@ Perl_sv_does_sv(pTHX_ SV *sv, SV *namesv, U32 flags) methodname = newSV_type(SVt_PV); SvLEN(methodname) = 0; SvCUR(methodname) = strlen(PL_isa_DOES); - SvPVX(methodname) = PL_isa_DOES; + SvPVX(methodname) = (char *)PL_isa_DOES; /* discard 'const' qualifier */ SvPOK_on(methodname); sv_2mortal(methodname); call_sv(methodname, G_SCALAR | G_METHOD); |