summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-10-20 16:29:48 +0100
committerDavid Mitchell <davem@iabyn.com>2015-10-28 12:55:28 +0000
commite9548aa6723a88345976cfd7d3b37feb4e405ae9 (patch)
tree6c36a9e056bee3c612568aca69a9440a04b474d7 /pp_sys.c
parent402d079e250e3dfdc9724f77bd7880f39e109b24 (diff)
downloadperl-e9548aa6723a88345976cfd7d3b37feb4e405ae9.tar.gz
pp_sys.c: silence g++ compiler warning
The warning is harmless but annoying
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 2ad44a0168..373590f234 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -545,9 +545,17 @@ Perl_tied_method(pTHX_ SV *methname, SV **sp, SV *const sv,
PUTBACK; /* sp is at *foot* of args, so this pops args from old stack */
PUSHSTACKi(PERLSI_MAGIC);
/* extend for object + args. If argc might wrap/truncate when cast
- * to SSize_t, set to -1 which will trigger a panic in EXTEND() */
+ * to SSize_t and incremented, set to -1, which will trigger a panic in
+ * EXTEND().
+ * The weird way this is written is because g++ is dumb enough to
+ * warn "comparison is always false" on something like:
+ *
+ * sizeof(a) >= sizeof(b) && a >= B_t_MAX -1
+ *
+ * (where the LH condition is false)
+ */
extend_size =
- sizeof(argc) >= sizeof(SSize_t) && argc > SSize_t_MAX - 1
+ (argc > (sizeof(argc) >= sizeof(SSize_t) ? SSize_t_MAX - 1 : argc))
? -1 : (SSize_t)argc + 1;
EXTEND(SP, extend_size);
PUSHMARK(sp);