diff options
author | Craig A. Berry <craigberry@mac.com> | 2015-01-25 15:22:50 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2015-01-25 17:08:07 -0600 |
commit | d28cce60f6f99594ae15d5ad385d305f91867d9e (patch) | |
tree | 1e56b1c526ed7184a04148b137ca464448ca5d99 /ext/B | |
parent | 0d9debd6d08cb7991a509776061cc9c7618aec64 (diff) | |
download | perl-d28cce60f6f99594ae15d5ad385d305f91867d9e.tar.gz |
Dodge warning with STATIC_ASSERT_STMT, VMS C++.
This is not a C++11 compiler so it's getting the emulated version
of static_assert and it doesn't like it in one case:
STATIC_ASSERT_STMT(SVf_FAKE >= 1<<(sizeof(PadnameFLAGS(pn)) * 8));
........^
%CXX-W-REFNESTFUNVAR, reference to local variable of enclosing function is
not allowed
at line number 3562 in file D0:[craig.blead.ext.B]b.c;1
While pn is in fact a local variable, it's in an enclosing struct,
not an enclosing function. Nevertheless, we don't actually need
anything from pn other than the size of one of its members, so
we'll just use a NULL pointer of the correct type rather than a
real live instance of that type. This is supposedly C89 so
shouldn't break anything else.
Diffstat (limited to 'ext/B')
-rw-r--r-- | ext/B/B.pm | 2 | ||||
-rw-r--r-- | ext/B/B.xs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm index 5cede4899b..f028d7ca04 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -15,7 +15,7 @@ require Exporter; # walkoptree comes from B.xs BEGIN { - $B::VERSION = '1.55'; + $B::VERSION = '1.56'; @B::EXPORT_OK = (); # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK. diff --git a/ext/B/B.xs b/ext/B/B.xs index 72a33ae8ee..735e2c586b 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -2421,7 +2421,7 @@ PadnameFLAGS(pn) /* backward-compatibility hack, which should be removed if the flags field becomes large enough to hold SVf_FAKE (and PADNAMEt_OUTER should be renumbered to match SVf_FAKE) */ - STATIC_ASSERT_STMT(SVf_FAKE >= 1<<(sizeof(PadnameFLAGS(pn)) * 8)); + STATIC_ASSERT_STMT(SVf_FAKE >= 1<<(sizeof(PadnameFLAGS((B__PADNAME)NULL)) * 8)); if (PadnameOUTER(pn)) RETVAL |= SVf_FAKE; OUTPUT: |