This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Dodge warning with STATIC_ASSERT_STMT, VMS C++.
authorCraig A. Berry <craigberry@mac.com>
Sun, 25 Jan 2015 21:22:50 +0000 (15:22 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sun, 25 Jan 2015 23:08:07 +0000 (17:08 -0600)
commitd28cce60f6f99594ae15d5ad385d305f91867d9e
tree1e56b1c526ed7184a04148b137ca464448ca5d99
parent0d9debd6d08cb7991a509776061cc9c7618aec64
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.
ext/B/B.pm
ext/B/B.xs