summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-03-04 14:49:22 +0000
committerDavid Mitchell <davem@iabyn.com>2015-03-04 14:49:22 +0000
commitd98e5cdeb3ac2db8525660fbbbe91c811785588c (patch)
tree558ffd2ba963d1ad54505f9df8de7b663e0d9bb5 /handy.h
parent88f9f1287d0ce35734ddb48ff7a8ee9f4b8efd3d (diff)
downloadperl-d98e5cdeb3ac2db8525660fbbbe91c811785588c.tar.gz
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.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/handy.h b/handy.h
index 5414df1f5c..5337c3fb77 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) \