In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d98e5cdeb3ac2db8525660fbbbe91c811785588c?hp=88f9f1287d0ce35734ddb48ff7a8ee9f4b8efd3d>
- Log ----------------------------------------------------------------- commit d98e5cdeb3ac2db8525660fbbbe91c811785588c Author: David Mitchell <[email protected]> Date: Wed Mar 4 14:49:22 2015 +0000 followup for MEM_WRAP_CHECK On my previous commit, I failed to save the edited handy.h file where I had edited the comments, so they were missed from the commit. ----------------------------------------------------------------------- Summary of changes: handy.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/handy.h b/handy.h index 5414df1..5337c3f 100644 --- a/handy.h +++ b/handy.h @@ -1891,20 +1891,20 @@ PoisonWith(0xEF) for catching access to freed memory. (sizeof(t) > ((MEM_SIZE)1 << 8*(sizeof(MEM_SIZE) - sizeof(n)))) /* This is written in a slightly odd way to avoid various spurious - * compiler warnings. We *want* to write - * _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) && (n > const) - * but even when the LHS constant-folds to false at compile-time, g++ - * insists on emitting warnings about the RHS (e.g. "comparison is always - * false"), so instead we write it as + * compiler warnings. We *want* to write the expression as + * _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) && (n > C) + * (for some compile-time constant C), but even when the LHS + * constant-folds to false at compile-time, g++ insists on emitting + * warnings about the RHS (e.g. "comparison is always false"), so instead + * we write it as * - * (cond ? n : X) > const + * (cond ? n : X) > C * - * where X is a constant where X > const is always false. - * Choosing a value for X is tricky. If 0, some compilers will - * complain about 0 > const always being false; if 1, Coverity - * complains when n happens to be the constant value '1', that cond ? 1 : 1 - * has the same value on both branches; so use const for X and hope - * that nothing else whines. + * where X is a constant with X > C always false. Choosing a value for X + * is tricky. If 0, some compilers will complain about 0 > C always being + * false; if 1, Coverity complains when n happens to be the constant value + * '1', that cond ? 1 : 1 has the same value on both branches; so use C + * for X and hope that nothing else whines. */ # define _MEM_WRAP_WILL_WRAP(n,t) \ -- Perl5 Master Repository
