Subject: | inflate.c: One (last?) compilation warning |
Paul,
Here's a compilation warning that I *wish* I had spotted before you finished up work on
https://rt.cpan.org/Ticket/Display.html?id=107642. :-(
Building Perl 5 blead on FreeBSD-11 with clang -- now the default compiler on FreeBSD -- gives this warning:
#####
inflate.c:1507:61: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
#####
See, e.g., http://perl5.test-smoke.org/report/52756
Here is the relevant code from cpan/Compress-Raw-Zlib/zlib-src/inflate.c:
#####
1502 long ZEXPORT inflateMark(
1503 z_streamp strm)
1504 {
1505 struct inflate_state FAR *state;
1506
1507 if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; # <-- warning at '<<'
1508 state = (struct inflate_state FAR *)strm->state;
1509 return ((long)(state->back) << 16) +
1510 (state->mode == COPY ? state->length :
1511 (state->mode == MATCH ? state->was - state->length : 0));
1512 }
#####
While eliminating this warning is probably not worth an entire new CPAN release, it would be nice to nail it before the 5.26 code freeze. It's the *very last* compilation warning being emitted by clang on FreeBSD11!
Thank you very much.
Jim Keenan