summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-01-17 11:37:54 +0000
committerGisle Aas <gisle@activestate.com>2006-01-17 11:37:54 +0000
commitbbbd43383bc4e5b5c9d9b30d4a2008afec8893d8 (patch)
tree9c440df82d626e6f6700db9d169a4b78b8a10c69
parent5b213ac8552d2007a5836890a1c4a2f8d9df150b (diff)
downloadperl-bbbd43383bc4e5b5c9d9b30d4a2008afec8893d8.tar.gz
More readable MEM_WRAP_CHECK_1() macro.
This form also avoids the "dead part of constant expression is nonconstant" warning from the Sun Studio 10 compiler. p4raw-id: //depot/perl@26871
-rw-r--r--README.solaris13
-rw-r--r--handy.h2
2 files changed, 1 insertions, 14 deletions
diff --git a/README.solaris b/README.solaris
index d3b541f8f1..427e08de6e 100644
--- a/README.solaris
+++ b/README.solaris
@@ -508,19 +508,6 @@ make sure that it includes the directory with the 'ar' command. This
is a common problem on Solaris, where 'ar' is in the /usr/ccs/bin/
directory.
-=item warning: dead part of constant expression is nonconstant
-
-If you are using the Sun Studio 10 compilers ('cc -V' reports "Sun C 5.7") you
-may see lots of these errors while building perl. This is an erroneous warning
-from the compiler, if you are interested in the details the Sun bug id is
-6344975. The warnings can safely be ignored, but if they bother you they may
-be suppressed by adding "-Accflags=-erroff=E_DEAD_NONCONST" to your Configure
-command-line. Note however that earlier versions of the compiler don't have the
-ability to report this warning and will complain about a bad message tag if you
-specify that you want the compiler to suppress the warning. Note also that the
-erroff option embedded into Config.pm and will be used for building any XSUB
-modules post-install.
-
=back
=head1 MAKE TEST
diff --git a/handy.h b/handy.h
index ada3124695..3f13a93853 100644
--- a/handy.h
+++ b/handy.h
@@ -636,7 +636,7 @@ hopefully catches attempts to access uninitialized memory.
#ifdef PERL_MALLOC_WRAP
#define MEM_WRAP_CHECK(n,t) MEM_WRAP_CHECK_1(n,t,PL_memory_wrap)
#define MEM_WRAP_CHECK_1(n,t,a) \
- (void)((sizeof(t)>1?(n):1)>((MEM_SIZE)~0)/sizeof(t)?(Perl_croak_nocontext(a),0):0)
+ (void)(sizeof(t) > 1 && (n) > ((MEM_SIZE)~0)/sizeof(t) && (Perl_croak_nocontext(a),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)))