Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile warning on Perl 5.8 #102

Open
pali opened this issue Jun 14, 2019 · 1 comment
Open

Compile warning on Perl 5.8 #102

pali opened this issue Jun 14, 2019 · 1 comment

Comments

@pali
Copy link
Contributor

pali commented Jun 14, 2019

https://travis-ci.org/Dual-Life/Devel-PPPort/jobs/544798841

cc -c   -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"3.52\" -DXS_VERSION=\"3.52\" -fPIC "-I/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE"  -W -Wall -Wdeclaration-after-statement RealPPPort.c
In file included from RealPPPort.xs:142:0:
ppport.h: In function ‘DPPP_my_utf8_to_uvchr_buf’:
ppport.h:4951:17: warning: passing argument 1 of ‘Perl_utf8n_to_uvuni’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
                 s, curlen, retlen,   (UTF8_ALLOW_ANYUV
                 ^
In file included from /home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/perl.h:4561:0,
                 from RealPPPort.xs:31:
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/proto.h:1341:18: note: expected ‘U8 * {aka unsigned char *}’ but argument is of type ‘const U8 * {aka const unsigned char *}’
 PERL_CALLCONV UV Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen
                  ^
In file included from RealPPPort.xs:142:0:
ppport.h:5001:45: warning: passing argument 1 of ‘Perl_utf8n_to_uvuni’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
                                             s, curlen, retlen, UTF8_ALLOW_ANY);
                                             ^
In file included from /home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/perl.h:4561:0,
                 from RealPPPort.xs:31:
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/proto.h:1341:18: note: expected ‘U8 * {aka unsigned char *}’ but argument is of type ‘const U8 * {aka const unsigned char *}’
 PERL_CALLCONV UV Perl_utf8n_to_uvuni(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen
                  ^
In file included from RealPPPort.xs:142:0:
ppport.h:5012:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
             if (retlen && *retlen >= 0) {
                                   ^
In file included from /home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/perl.h:4547:0,
                 from RealPPPort.xs:31:
RealPPPort.xs: In function ‘XS_Devel__PPPort_other_variables’:
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_expect’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2911:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(ppp_expect_t, PL_expect);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_copline’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2912:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(line_t, PL_copline);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_rsfp’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2913:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(ppp_rsfp_t, PL_rsfp);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_rsfp_filters’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2914:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(AV *, PL_rsfp_filters);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_linestr’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2915:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(SV *, PL_linestr);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_bufptr’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2916:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(char *, PL_bufptr);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_bufend’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2917:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(char *, PL_bufend);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_lex_state’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2918:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(ppp_lex_state_t, PL_lex_state);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_lex_stuff’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2919:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(SV *, PL_lex_stuff);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_error_count’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2920:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(ppp_error_count_t, PL_error_count);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_in_my’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2921:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(ppp_in_my_t, PL_in_my);
                 ^
RealPPPort.xs:277:50: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_in_my_stash’ will never be NULL [-Waddress]
                                     mXPUSHi(&var != NULL);       \
                                                  ^
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/pp.h:328:73: note: in definition of macro ‘mXPUSHi’
 ine mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT
                                                                     ^
RealPPPort.xs:2923:17: note: in expansion of macro ‘ppp_PARSERVAR’
                 ppp_PARSERVAR(HV*, PL_in_my_stash);
                 ^
cc -c   -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"3.52\" -DXS_VERSION=\"3.52\" -fPIC "-I/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE"  -W -Wall -Wdeclaration-after-statement module2.c
In file included from module2.c:21:0:
/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE/patchlevel.h:122:20: warning: ‘local_patches’ defined but not used [-Wunused-variable]
 static const char *local_patches[] = {
                    ^
cc -c   -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"3.52\" -DXS_VERSION=\"3.52\" -fPIC "-I/home/travis/perl5/perlbrew/perls/5.8/lib/5.8.9/x86_64-linux/CORE"  -W -Wall -Wdeclaration-after-statement module3.c
module3.c: In function ‘dummy_parser_warning’:
module3.c:70:21: warning: the comparison will always evaluate as ‘true’ for the address of ‘PL_bufptr’ will never be NULL [-Waddress]
   return &PL_bufptr != NULL;
                     ^
@atoomic
Copy link
Member

atoomic commented Jun 14, 2019

excellent to have reported these warnings using one case per version,
most of them should be pretty easy to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants