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

Swapped warnings for -o and -O file tests #8042

Closed
p5pRT opened this issue Jul 27, 2005 · 5 comments
Closed

Swapped warnings for -o and -O file tests #8042

p5pRT opened this issue Jul 27, 2005 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 27, 2005

Migrated from rt.perl.org#36672 (status was 'resolved')

Searchable as RT36672$

@p5pRT
Copy link
Author

p5pRT commented Jul 27, 2005

From pfusik@op.pl

This is a bug report for perl from pfusik@​op.pl,
generated with the help of perlbug 1.35 running under perl v5.8.7.


$ perl -we '-o'
Use of uninitialized value in -O at -e line 1.

$ perl -we '-O'
Use of uninitialized value in -o at -e line 1.

I have no idea if anything other than warnings can be affected by this bug.
A patch is attached.



Flags​:
  category=core
  severity=low


Site configuration information for perl v5.8.7​:

Configured by ActiveState at Sat Jun 4 07​:30​:27 PDT 2005.

Summary of my perl5 (revision 5 version 8 subversion 7) configuration​:
  Platform​:
  osname=linux, osvers=2.2.17, archname=i686-linux-thread-multi
  uname='linux gimlet 2.2.17 #1 sun jun 25 09​:24​:41 est 2000 i686 unknown '

config_args='-ders -Dcc=gcc -Dusethreads -Duseithreads -Ud_sigsetjmp -Uinstallusrbinperl -Ulocincpth= -Uloclibpth= -Accflags=-DUSE_S
ITECUSTOMIZE -Duselargefiles -Accflags=-DNO_HASH_SEED -Uusemallocwrap -Dinc_version_list=5.8.6/$archname 5.8.6 5.8.4/$archname 5.8.4
5.8.3/$archname 5.8.3 5.8.2/$archname 5.8.2 5.8.1/$archname 5.8.1 5.8.0/$archname
5.8.0 -Duseshrplib -Dprefix=/opt/ActivePerl-5.8 -Accflags=-DBUILT_BY_ACTIVESTATE -Dcf_by=ActiveState -Dcf_email=support@​ActiveState.
com'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags
='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -DBUILT_BY_ACTIVESTATE -fno-strict-aliasing -pip
e -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',

cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DUSE_SITECUSTOMIZE -DNO_HASH_SEED -DBUILT_BY_ACTIVESTATE -fno-strict-alias
ing -pipe'
  ccversion='', gccversion='2.95.2 20000220 (Debian GNU/Linux)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=4, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =''
  libpth=/lib /usr/lib /usr/local/lib
  libs=-lnsl -lndbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lposix
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc -lposix
  libc=/lib/libc-2.1.3.so, so=so, useshrplib=true, libperl=libperl.so
  gnulibc_version='2.1.3'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-Wl,-E -Wl,-rpath,/opt/ActivePerl-5.8/lib/5.8.7/i686-linux-thread-multi/CORE'
  cccdlflags='-fpic', lddlflags='-shared'

Locally applied patches​:
  ACTIVEPERL_LOCAL_PATCHES_ENTRY
  # if !defined(PERL_DARWIN)
  Iin_load_module moved for compatibility with build 806
  # endif
  # if defined(__hpux)
  Avoid signal flag SA_RESTART for older versions of HP-UX
  # endif
  PerlEx hacks for CGI​::Carp
  Less verbose ExtUtils​::Install and Pod​::Find
  instmodsh upgraded from ExtUtils-MakeMaker-6.25
  24699 ICMP_UNREACHABLE handling in Net​::Ping
  21540 Fix backward-compatibility issues in if.pm


@​INC for perl v5.8.7​:
  /opt/ActivePerl-5.8/lib/5.8.7/i686-linux-thread-multi
  /opt/ActivePerl-5.8/lib/5.8.7
  /opt/ActivePerl-5.8/lib/site_perl/5.8.7/i686-linux-thread-multi
  /opt/ActivePerl-5.8/lib/site_perl/5.8.7
  /opt/ActivePerl-5.8/lib/site_perl
  .


Environment for perl v5.8.7​:
  HOME=/home/fox
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/opt/ActivePerl-5.8/bin​:/usr/local/bin​:/usr/bin​:/bin​:/usr/X11R6/bin​:/usr/java/j2sdk1.4.2_01/bin​:/home/fox/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jul 27, 2005

From pfusik@op.pl

ofiletest.patch
diff -ruN perl-current/opcode.h perl-patched/opcode.h
--- perl-current/opcode.h	2005-05-11 08:24:00.000000000 +0200
+++ perl-patched/opcode.h	2005-07-27 22:46:36.000000000 +0200
@@ -635,8 +635,8 @@
 	"-w",
 	"-x",
 	"-e",
-	"-O",
 	"-o",
+	"-O",
 	"-z",
 	"-s",
 	"-M",
diff -ruN perl-current/opcode.pl perl-patched/opcode.pl
--- perl-current/opcode.pl	2005-05-11 08:24:00.000000000 +0200
+++ perl-patched/opcode.pl	2005-07-27 22:46:34.000000000 +0200
@@ -809,8 +809,8 @@
 ftewrite	-w			ck_ftst		isu-	F-
 fteexec		-x			ck_ftst		isu-	F-
 ftis		-e			ck_ftst		isu-	F-
-fteowned	-O			ck_ftst		isu-	F-
-ftrowned	-o			ck_ftst		isu-	F-
+fteowned	-o			ck_ftst		isu-	F-
+ftrowned	-O			ck_ftst		isu-	F-
 ftzero		-z			ck_ftst		isu-	F-
 ftsize		-s			ck_ftst		istu-	F-
 ftmtime		-M			ck_ftst		stu-	F-
diff -ruN perl-current/t/op/filetest.t perl-patched/t/op/filetest.t
--- perl-current/t/op/filetest.t	2004-03-22 00:00:00.000000000 +0100
+++ perl-patched/t/op/filetest.t	2005-07-27 23:20:19.000000000 +0200
@@ -10,7 +10,7 @@
 }
 
 use Config;
-plan(tests => 22);
+plan(tests => 24);
 
 ok( -d 'op' );
 ok( -f 'TEST' );
@@ -78,3 +78,23 @@
 ok( -x -d -x 'op' );
 ok( (-s -f 'TEST' > 1), "-s returns real size" );
 ok( -f -s 'TEST' == 1 );
+
+# Test -o and -O in warning messages (they used to be swapped)
+
+{
+	use warnings;
+    my $warn = '';
+    local $SIG{'__WARN__'} = sub { $warn .= join '', @_; };
+	local $_;
+	-o;
+    like($warn, qr/in -o /);
+}
+
+{
+	use warnings;
+    my $warn = '';
+    local $SIG{'__WARN__'} = sub { $warn .= join '', @_; };
+	local $_;
+	-O;
+    like($warn, qr/in -O /);
+}

@p5pRT
Copy link
Author

p5pRT commented Jul 28, 2005

From @rgs

Piotr Fusik wrote​:

$ perl -we '-o'
Use of uninitialized value in -O at -e line 1.

$ perl -we '-O'
Use of uninitialized value in -o at -e line 1.

I have no idea if anything other than warnings can be affected by this bug.
A patch is attached.

Thanks, applied, as #25232, except the test. It's already tested by
warnings.t (in t/lib/warnings/9uninit) and the existing test was
wrong...

@p5pRT
Copy link
Author

p5pRT commented Jul 28, 2005

The RT System itself - Status changed from 'new' to 'open'

@p5pRT p5pRT closed this as completed Jul 28, 2005
@p5pRT
Copy link
Author

p5pRT commented Jul 28, 2005

@rgs - Status changed from 'open' to 'resolved'

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

1 participant