This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Storable: add SEEN0 macro
authorDavid Mitchell <davem@iabyn.com>
Thu, 21 Nov 2013 11:15:43 +0000 (11:15 +0000)
committerDavid Mitchell <davem@iabyn.com>
Thu, 21 Nov 2013 17:12:42 +0000 (17:12 +0000)
commit997ca471cc5e30128a8804a59833b5cca3e4b433
tree25d918aaeff22c8ebad25476041049b8d433d2b1
parentbea498fabb16343e9e194390c9e6a35aca06900a
Storable: add SEEN0 macro

to shut up a compiler warning.

The SEEN(y,stash,i) macro expands to something like

    ...;
    if (stash)
       foo_NN(stash);

where foo_NN is a function that expects a non-null arg.

SEEN() is sometimes called as SEEN(sv,0,0) which of course expands to

    if (0)
       foo_NN(0);

which under gcc at least, emits the 'non-null' warning before the entire
block of code is optimised away.

So add a SEEN0() macro which handles the stash=0 case.
dist/Storable/Storable.pm
dist/Storable/Storable.xs