This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
extend MEM_WRAP_CHECK supress warning hack to MEM_WRAP_CHECK_*
authorDave Mitchell <davem@fdisolutions.com>
Sun, 10 Jul 2005 11:15:32 +0000 (11:15 +0000)
committerDave Mitchell <davem@fdisolutions.com>
Sun, 10 Jul 2005 11:15:32 +0000 (11:15 +0000)
p4raw-id: //depot/perl@25103

handy.h

diff --git a/handy.h b/handy.h
index d0366c3..a110080 100644 (file)
--- a/handy.h
+++ b/handy.h
@@ -603,11 +603,11 @@ hopefully catches attempts to access uninitialized memory.
 
 #ifdef PERL_MALLOC_WRAP
 #define MEM_WRAP_CHECK(n,t) \
-       (void)((sizeof(t)>1?n:1)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(PL_memory_wrap),0):0)
+       (void)((sizeof(t)>1?(n):1)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(PL_memory_wrap),0):0)
 #define MEM_WRAP_CHECK_1(n,t,a) \
-       (void)((n)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(a),0):0)
+       (void)((sizeof(t)>1?(n):1)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(a),0):0)
 #define MEM_WRAP_CHECK_2(n,t,a,b) \
-       (void)((n)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(a,b),0):0)
+       (void)((sizeof(t)>1?(n):1)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(a,b),0):0)
 #define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),
 
 #define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > (MEM_SIZE)~0 - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (Perl_croak_nocontext(PL_memory_wrap),0):0),((n-1+PERL_STRLEN_ROUNDUP_QUANTUM)&~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM-1)))