This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rpeep(): silence compiler warning
authorDavid Mitchell <davem@iabyn.com>
Wed, 2 Dec 2015 11:49:04 +0000 (11:49 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 2 Dec 2015 12:08:48 +0000 (12:08 +0000)
commit473edb6554ba163273fdcd621aab071bffbb16d3
tree9ecce3d4d3b7de5c87eed490af70ab471586a4c3
parent7a4fcb3f64df51eacf89f69a4bf76386aea1e8e3
rpeep(): silence  compiler warning

op.c: In function ‘Perl_rpeep’:
op.c:13666:35: warning: comparison is always false due to limited range of data
type [-Wtype-limits]

This condition is always false if for example base is 32 bit and UVs are 64
bit:

    base >  (UV_MAX >> (OPpPADRANGE_COUNTSHIFT+SAVE_TIGHT_SHIFT)

silence the warning by replacing base with a constant-folded conditional

    (cond ? base : 0) > ....

where cond is false if sizeof(base) is small.
op.c