[Bug 210837] lang/perl5.22 (and related?): ext/re/re_exec.c has long long format matched up with long argument

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Aug 1 22:20:26 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210837

--- Comment #12 from Mark Millard <markmi at dsl-only.net> ---
(In reply to Mark Millard from comment #11)

[Note: Escape sequences hand edited out. Watch for editing errors in the
deletions.]

amd64 11.0-BETA3 without the patch got:

# grep -h arning: ~/ports_typescripts/perl5_22_initial_build.typescript
op.c:3397:26: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:3445:15: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:9084:8: warning: nonnull parameter 'name' will evaluate to 'true' on first
encounter [-Wpointer-bool-conversion]
op.c:3397:26: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:3445:15: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:9084:8: warning: nonnull parameter 'name' will evaluate to 'true' on first
encounter [-Wpointer-bool-conversion]
inflate.c:1507:61: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
ListUtil.xs:688:17: warning: unused variable 'a' [-Wunused-variable]
ListUtil.xs:689:17: warning: unused variable 'b' [-Wunused-variable]
ListUtil.xs:730:17: warning: unused variable 'a' [-Wunused-variable]
ListUtil.xs:731:17: warning: unused variable 'b' [-Wunused-variable]
Opcode.xs:230:5: warning: unused variable 'my_cxtp' [-Wunused-variable]
./sdbm.h:54:20: warning: 'extern' variable has an initializer
[-Wextern-initializer]
Piece.xs:688:18: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
Piece.xs:782:18: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
Piece.xs:1059:29: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
Piece.xs:350:13: warning: unused variable 'copyright' [-Wunused-variable]
Piece.xs:352:13: warning: unused variable 'sccsid' [-Wunused-variable]
<command line>:11:9: warning: 'TIME_HIRES_STAT' macro redefined
[-Wmacro-redefined]


With the patch amd64 got those too, including the int vs. unsigned long notices
that mean 32-bit vs. 64-bit in addition to signed vs. unsigned.

# grep arning: ~/ports_typescripts/perl5_22_patched_build.typescript | more
op.c:3397:26: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:3445:15: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:9084:8: warning: nonnull parameter 'name' will evaluate to 'true' on first
encounter [-Wpointer-bool-conversion]
op.c:3397:26: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:3445:15: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
op.c:9084:8: warning: nonnull parameter 'name' will evaluate to 'true' on first
encounter [-Wpointer-bool-conversion]
inflate.c:1507:61: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
ListUtil.xs:688:17: warning: unused variable 'a' [-Wunused-variable]
ListUtil.xs:689:17: warning: unused variable 'b' [-Wunused-variable]
ListUtil.xs:730:17: warning: unused variable 'a' [-Wunused-variable]
ListUtil.xs:731:17: warning: unused variable 'b' [-Wunused-variable]
Opcode.xs:230:5: warning: unused variable 'my_cxtp' [-Wunused-variable]
./sdbm.h:54:20: warning: 'extern' variable has an initializer
[-Wextern-initializer]
<command line>:11:9: warning: 'TIME_HIRES_STAT' macro redefined
[-Wmacro-redefined]
Piece.xs:688:18: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
Piece.xs:782:18: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
Piece.xs:1059:29: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
Piece.xs:350:13: warning: unused variable 'copyright' [-Wunused-variable]
Piece.xs:352:13: warning: unused variable 'sccsid' [-Wunused-variable]

So for amd64 with and without the patch does not change the warnings. This is
likely a expected/hoped-for result.

The nonnull parameter will evaluate to true warnings are:

--- op.o ---
op.c:3397:26: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
    SV * const stashsv = stash ? newSVhek(HvNAME_HEK(stash)) : &PL_sv_no;
                         ^~~~~ ~
op.c:3445:15: warning: nonnull parameter 'stash' will evaluate to 'true' on
first encounter [-Wpointer-bool-conversion]
    stashsv = stash ? newSVhek(HvNAME_HEK(stash)) : &PL_sv_no;
              ^~~~~ ~
op.c:9084:8: warning: nonnull parameter 'name' will evaluate to 'true' on first
encounter [-Wpointer-bool-conversion]
        name, name ? strlen(name) : 0, subaddr, NULL, NULL, NULL, 0
              ^~~~ ~
./embed.h:1274:69: note: expanded from macro 'newXS_len_flags'
#define newXS_len_flags(a,b,c,d,e,f,g)  Perl_newXS_len_flags(aTHX_
a,b,c,d,e,f,g)
                                                                     ^


The inflate.c shifting of a negative signed value being undefined is from:

--- inflate.o ---
cc -c  -I./zlib-src  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing
-pipe -fstack-protector-strong -I/usr/local/include -Wall
-Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -pipe
-g -fstack-protector -fno-strict-aliasing    -DVERSION=\"2.068\" 
-DXS_VERSION=\"2.068\" -DPIC -fPIC "-I../.."  -DNO_VIZ -DZ_SOLO  
-DGZIP_OS_CODE=3 inflate.c
--- lib/auto/DB_File/DB_File.so ---
LD_LIBRARY_PATH=/usr/obj/portswork/usr/ports/lang/perl5.22/work/perl\-5.22.2
./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.so  MAKE="/usr/bin/make"
LIBPERL_A=libperl.so.5.22.2 LINKTYPE=dynamic
--- lib/auto/Compress/Raw/Zlib/Zlib.so ---
inflate.c:1507:61: warning: shifting a negative signed value is undefined
[-Wshift-negative-value]
    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
                                                        ~~~ ^

The extern variable with an initializer is for:

--- sdbm.o ---
cc -c  -I../..  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing
-pipe -fstack-protector-strong -I/usr/local/include -Wall
-Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -pipe
-g -fstack-protector -fno-strict-aliasing    -DVERSION=\"1.13
\"  -DXS_VERSION=\"1.13\" -DPIC -fPIC "-I../.."  -DSDBM -DDUFF sdbm.c
In file included from sdbm.c:15:
./sdbm.h:54:20: warning: 'extern' variable has an initializer
[-Wextern-initializer]
extern const datum nullitem
                   ^


The TIME_HIRES_STAT notices are:

--- HiRes.o ---
cc -c    -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe
-fstack-protector-strong -I/usr/local/include -Wall
-Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -pipe
-g -fstack-protector -fno-strict-aliasing    -DVERSION=\"1.9726\" 
-DXS_VERSION=\"1.9726\" -DPIC -fPIC "-I../.."  -DTIME_HIRES_NANOSLEEP
-DTIME_HIRES_CLOCK_GETTIME -DTIME_HIRES_CLOCK_GETRES -DTIME_HIRES_CLOCK
-DTIME_HIRES_STAT=1 -DTIME_HIRES_STAT=4 -DATLEASTFIVEOHOHFIVE HiRes.c
In file included from <built-in>:319:
<command line>:11:9: warning: 'TIME_HIRES_STAT' macro redefined
[-Wmacro-redefined]
#define TIME_HIRES_STAT 4
        ^
<command line>:10:9: note: previous definition is here
#define TIME_HIRES_STAT 1
        ^

which are from the command-line -D's.



The (signed) int vs. unsigned long warnings are for:

--- lib/auto/Time/Piece/Piece.so ---
Piece.xs:688:18: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
                        for (i = 0; i < asizeof(Locale->weekday); i++) {
                                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~
Piece.xs:782:18: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
                        for (i = 0; i < asizeof(Locale->month); i++) {
                                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~
Piece.xs:1059:29: warning: comparison of integers of different signs: 'int' and
'unsigned long' [-Wsign-compare]
. . .
--- lib/auto/Time/Piece/Piece.so ---
        if ((len > 0 && len < sizeof(tmpbuf)) || (len == 0 && *fmt == '\0'))
                        ~~~ ^ ~~~~~~~~~~~~~~

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-perl mailing list