Skip Menu |
Report information
Id: 4521
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ysth <sthoenna [at] efn.org>
Cc:
AdminCc:

Operating System: os2
PatchStatus: (no value)
Severity: low
Type: library
Perl Version: 5.7.0
Fixed In: (no value)



Date: Thu, 26 Oct 2000 14:00:03 -0700 (PDT)
To: perlbug [...] perl.org
Subject: C<use integer; $x += 1> gives uninitialized warning
From: sthoenna [...] efn.org
Download (untitled) / with headers
text/plain 4.6k
This is a bug report for perl from sthoenna@efn.org, generated with the help of perlbug 1.32 running under perl v5.7.0. ----------------------------------------------------------------- [Please enter your report here] += and -= give an uninitialized warning only when under use integer: [D:\home\sthoenna]perl -we "$x += 1; print $x" 1 [D:\home\sthoenna]perl -we "$x -= 1; print $x" -1 [D:\home\sthoenna]perl -we "use integer; $x += 1; print $x" Use of uninitialized value in integer addition (+) at -e line 1. 1 [D:\home\sthoenna]perl -we "use integer; $x -= 1; print $x" Use of uninitialized value in integer subtraction (-) at -e line 1. -1 --, ++, +=, -=, |=, and ^= are supposed to not give this warning. Patch (to 7348): --- pp.c.orig Sun Oct 15 19:21:44 2000 +++ pp.c Thu Oct 26 11:23:48 2000 @@ -1566,7 +1566,7 @@ { djSP; dATARGET; tryAMAGICbin(add,opASSIGN); { - dPOPTOPiirl; + dPOPTOPiirl_ul; SETi( left + right ); RETURN; } @@ -1576,7 +1576,7 @@ { djSP; dATARGET; tryAMAGICbin(subtr,opASSIGN); { - dPOPTOPiirl; + dPOPTOPiirl_ul; SETi( left - right ); RETURN; } --- t/op/assignwarn.t.orig Thu Sep 14 19:55:14 2000 +++ t/op/assignwarn.t Thu Oct 26 13:53:40 2000 @@ -21,7 +21,7 @@ sub uninitialized { $warn =~ s/Use of uninitialized value[^\n]+\n//s; } -print "1..23\n"; +print "1..32\n"; { my $x; $x ++; ok 1, ! uninitialized; } { my $x; $x --; ok 2, ! uninitialized; } @@ -55,7 +55,19 @@ { my $x; $x |= "x"; ok 21, ! uninitialized; } { my $x; $x ^= "x"; ok 22, ! uninitialized; } -ok 23, $warn eq ''; +{ use integer; my $x; $x += 1; ok 23, ! uninitialized; } +{ use integer; my $x; $x -= 1; ok 24, ! uninitialized; } + +{ use integer; my $x; $x *= 1; ok 25, uninitialized; } +{ use integer; my $x; $x /= 1; ok 26, uninitialized; } +{ use integer; my $x; $x %= 1; ok 27, uninitialized; } + +{ use integer; my $x; $x ++; ok 28, ! uninitialized; } +{ use integer; my $x; $x --; ok 29, ! uninitialized; } +{ use integer; my $x; ++ $x; ok 30, ! uninitialized; } +{ use integer; my $x; -- $x; ok 31, ! uninitialized; } + +ok 32, $warn eq ''; # If we got any errors that we were not expecting, then print them print map "#$_\n", split /\n/, $warn if length $warn; [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=core severity=low --- Site configuration information for perl v5.7.0: Configured by sthoenna at Tue Oct 17 22:38:09 PDT 2000. Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration: Platform: osname=os2, osvers=2.30, archname=os2-64int-ld uname='os2 efn.org 2 2.30 i386 ' config_args='-de -Dprefix=d:/perl -Dusedevel -Duse64bitint -Duselongdouble -Aoptimize=-DDEBUGGING' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=undef uselongdouble=define Compiler: cc='gcc', ccflags ='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -D_EMX_CRT_REV_=63', optimize='-O2 -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -s -DDEBUGGING', cppflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -D_EMX_CRT_REV_=63' ccversion='', gccversion='2.8.1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=4 alignbytes=4, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags ='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000' libpth=d:/emx/lib d:/emx/lib/mt libs=-lsocket -lm -lbsd perllibs=-lsocket -lm -lbsd libc=d:/emx/lib/mt/c_import.lib, so=dll, useshrplib=true, libperl=libperl.lib Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-Zdll', lddlflags='-Zdll -Zomf -Zmt -Zcrtdll -s' Locally applied patches: DEVEL7347 --- @INC for perl v5.7.0: lib d:/perl/lib/5.7.0/os2-64int-ld d:/perl/lib/5.7.0 d:/perl/lib/site_perl/5.7.0/os2-64int-ld d:/perl/lib/site_perl/5.7.0 d:/perl/lib/site_perl . --- Environment for perl v5.7.0: HOME=d:\home\sthoenna LANG=en_us LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR=sthoenna PATH=d:\bin;C:\OS2;d:\perl\bin;C:\OS2\SYSTEM;C:\OS2\INSTALL;C:\;C:\OS2\MDOS;C:\OS2\APPS;C:\MMOS2;d:\os2apps\util;d:\DOSAPPS\UTIL;c:\sio;D:\WINDOWS;d:\pdksh;d:\emx\bin;d:\emacs\19.33\bin;d:\ispell PERL_BADLANG (unset) PERL_SH_DIR=d:\BIN SHELL (unset)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org