From ac07059afc757c4489adb6742202b936db323432 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Sat, 28 Nov 2015 17:09:13 +0000 Subject: FOOMARK debugging macros: fix %d cast; only -Dsv The debugging variants of POPMARK() etc: use %IVdf rather than %d to avoid compiler warnings when sizeof(IV) != sizeof(int); also, make these macros trigger only under -Dsv rather than just -Ds (-v is the verbose variant). --- pp.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'pp.h') diff --git a/pp.h b/pp.h index 60fe9ee1f8..61c3c3e181 100644 --- a/pp.h +++ b/pp.h @@ -62,26 +62,30 @@ Refetch the stack pointer. Used after a callback. See L. if (UNLIKELY((mark_stack_entry = ++PL_markstack_ptr) == PL_markstack_max)) \ mark_stack_entry = markstack_grow(); \ *mark_stack_entry = (I32)((p) - PL_stack_base); \ - DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK push %p %d\n", \ - PL_markstack_ptr, *mark_stack_entry)); \ + DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log, \ + "MARK push %p %"IVdf"\n", \ + PL_markstack_ptr, (IV)*mark_stack_entry))); \ } STMT_END # define TOPMARK \ ({ \ - DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK top %p %d\n", \ - PL_markstack_ptr, *PL_markstack_ptr)); \ + DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log, \ + "MARK top %p %"IVdf"\n", \ + PL_markstack_ptr, (IV)*PL_markstack_ptr))); \ *PL_markstack_ptr; \ }) # define POPMARK \ ({ \ - DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK pop %p %d\n", \ - (PL_markstack_ptr-1), *(PL_markstack_ptr-1))); \ + DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log, \ + "MARK pop %p %"IVdf"\n", \ + (PL_markstack_ptr-1), (IV)*(PL_markstack_ptr-1)))); \ assert((PL_markstack_ptr > PL_markstack) || !"MARK underflow");\ *PL_markstack_ptr--; \ }) # define INCMARK \ ({ \ - DEBUG_s(PerlIO_printf(Perl_debug_log, "MARK inc %p %d\n", \ - (PL_markstack_ptr+1), *(PL_markstack_ptr+1))); \ + DEBUG_s(DEBUG_v(PerlIO_printf(Perl_debug_log, \ + "MARK inc %p %"IVdf"\n", \ + (PL_markstack_ptr+1), (IV)*(PL_markstack_ptr+1)))); \ *PL_markstack_ptr++; \ }) #else -- cgit v1.2.1