This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Storable: Fix compile warning: comparison between signed and unsigned integer expressions
authorPali <pali@cpan.org>
Mon, 2 Dec 2019 15:09:46 +0000 (16:09 +0100)
committerKarl Williamson <khw@cpan.org>
Mon, 2 Dec 2019 16:23:11 +0000 (08:23 -0800)
gcc -m32 -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -Wall -Werror=declaration-after-statement -Werror=pointer-arith -Wextra -Wc++-compat -Wwrite-strings -O2   -DVERSION=\"3.18\" -DXS_VERSION=\"3.18\" -fPIC "-I../.."   Storable.c
Storable.xs: In function ‘retrieve_lvstring’:
Storable.xs:1238:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         else if (PerlIO_read(cxt->fio, x, y) != y) {            \
                                              ^
Storable.xs:1238:46: note: in definition of macro ‘SAFEPVREAD’
         else if (PerlIO_read(cxt->fio, x, y) != y) {            \
                                              ^~

dist/Storable/Storable.xs

index b68ebda..2f112c1 100644 (file)
@@ -5958,7 +5958,7 @@ static SV *retrieve_lvstring(pTHX_ stcxt_t *cxt, const char *cname)
     }
 
     New(10003, s, len+1, char);
-    SAFEPVREAD(s, len, s);
+    SAFEPVREAD(s, (I32)len, s);
 
     sv = retrieve(aTHX_ cxt, cname);
     if (!sv) {