silence compiler warnings using INCMARK/POPMARK
authorDavid Mitchell <davem@iabyn.com>
Thu, 19 Nov 2015 10:03:04 +0000 (10:03 +0000)
committerDavid Mitchell <davem@iabyn.com>
Thu, 19 Nov 2015 10:30:54 +0000 (10:30 +0000)
v5.23.3-305-g6cae08a introduced debugging variants of INCMARK/POPMARK, and
replaced a number of "PL_markstack_ptr--;" with "POPMARK;" etc.

This spews a bunch of "value computed is not used" warnings; so
add some "(void)"s.

Also indent the new definitions of INCMARK/POPMARK correctly.

perl.c
pp.h

diff --git a/perl.c b/perl.c
index 8182562..b8d98ff 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -2776,9 +2776,9 @@ Perl_call_sv(pTHX_ SV *sv, VOL I32 flags)
     }
     else {
        myop.op_other = (OP*)&myop;
-       POPMARK;
+       (void)POPMARK;
        create_eval_scope(flags|G_FAKINGEVAL);
-       INCMARK;
+       (void)INCMARK;
 
        JMPENV_PUSH(ret);
 
diff --git a/pp.h b/pp.h
index 945d1e5..687b0ca 100644 (file)
--- a/pp.h
+++ b/pp.h
@@ -56,7 +56,7 @@ Refetch the stack pointer.  Used after a callback.  See L<perlcall>.
 #define TARG targ
 
 #if defined(DEBUGGING) && defined(PERL_USE_GCC_BRACE_GROUPS)
-#define PUSHMARK(p)                                                   \
+#  define PUSHMARK(p)                                                   \
     STMT_START {                                                      \
         I32 * mark_stack_entry;                                       \
         if (UNLIKELY((mark_stack_entry = ++PL_markstack_ptr) == PL_markstack_max)) \
@@ -65,36 +65,36 @@ Refetch the stack pointer.  Used after a callback.  See L<perlcall>.
         DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK push %p %d\n",    \
                 PL_markstack_ptr, *mark_stack_entry));                \
     } STMT_END
-#define TOPMARK                                                       \
+#  define TOPMARK                                                       \
     ({                                                                \
         DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK top  %p %d\n",    \
                 PL_markstack_ptr, *PL_markstack_ptr));                \
         *PL_markstack_ptr;                                            \
     })
-#define POPMARK                                                       \
+#  define POPMARK                                                       \
     ({                                                                \
         DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK pop  %p %d\n",    \
                 (PL_markstack_ptr-1), *(PL_markstack_ptr-1)));        \
         assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow");\
         *PL_markstack_ptr--;                                          \
     })
-#define INCMARK                                                       \
+#  define INCMARK                                                       \
     ({                                                                \
         DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK inc  %p %d\n",    \
                 (PL_markstack_ptr+1), *(PL_markstack_ptr+1)));        \
         *PL_markstack_ptr++;                                          \
     })
 #else
-#define PUSHMARK(p)                                                   \
+#  define PUSHMARK(p)                                                   \
     STMT_START {                                                     \
         I32 * mark_stack_entry;                                       \
         if (UNLIKELY((mark_stack_entry = ++PL_markstack_ptr) == PL_markstack_max)) \
            mark_stack_entry = markstack_grow();                      \
         *mark_stack_entry  = (I32)((p) - PL_stack_base);              \
     } STMT_END
-#define TOPMARK                (*PL_markstack_ptr)
-#define POPMARK                (*PL_markstack_ptr--)
-#define INCMARK                (*PL_markstack_ptr++)
+#  define TOPMARK                (*PL_markstack_ptr)
+#  define POPMARK                (*PL_markstack_ptr--)
+#  define INCMARK                (*PL_markstack_ptr++)
 #endif
 
 #define dSP            SV **sp = PL_stack_sp
@@ -603,7 +603,7 @@ Does not use C<TARG>.  See also C<L</XPUSHu>>, C<L</mPUSHu>> and C<L</PUSHu>>.
                while (jump_o->op_type == OP_NULL)              \
                    jump_o = jump_o->op_next;                   \
                assert(jump_o->op_type == OP_ENTERSUB);         \
-               POPMARK;                                        \
+               (void)POPMARK;                                        \
                return jump_o->op_next;                         \
            }                                                   \
            return NORMAL;                                      \