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

[PATCH] Removed 'once' warnings in ExtUtils::Packlist::mkfh #11842

Closed
p5pRT opened this issue Jan 2, 2012 · 9 comments
Closed

[PATCH] Removed 'once' warnings in ExtUtils::Packlist::mkfh #11842

p5pRT opened this issue Jan 2, 2012 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 2, 2012

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

Searchable as RT107410$

@p5pRT
Copy link
Author

p5pRT commented Jan 2, 2012

From joel.a.berger@gmail.com

Message-Id​: <5.14.0_21216_1325530731@​joel-netbook>
Reply-To​: joel.a.berger@​gmail.com

This is a bug report for perl from joel.a.berger@​gmail.com,
generated with the help of perlbug 1.39 running under perl 5.14.0.

From f9b6487e96583d68a3afa56997ea91667fb2b8d8 Mon Sep 17 00​:00​:00 2001
From​: Joel Berger <joel.a.berger@​gmail.com>
Date​: Mon, 2 Jan 2012 12​:55​:52 -0600
Subject​: [PATCH] Removed 'once' warnings in ExtUtils​::Packlist​::mkfh.
Fixes cpan bug #50315.


dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
index 094c4cd..9ef48b7 100644
--- a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
+++ b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
@​@​ -24,6 +24,7 @​@​ Make a filehandle. Same kind of idea as Symbol​::gensym().
sub mkfh()
{
no strict;
+no warnings 'once';
my $fh = \*{$fhname++};
use strict;
return($fh);
--
1.7.4.1


Flags​:
  category=library
  severity=low
  module=ExtUtils​::Packlist


Site configuration information for perl 5.14.0​:

Configured by joel at Sat May 21 21​:12​:58 CDT 2011.

Summary of my perl5 (revision 5 version 14 subversion 0) configuration​:

  Platform​:
  osname=linux, osvers=2.6.38-8-generic, archname=i686-linux
  uname='linux joel-netbook 2.6.38-8-generic #42-ubuntu smp mon apr
11 03​:31​:50 utc 2011 i686 i686 i386 gnulinux '
  config_args='-de -Dprefix=/home/joel/perl5/perlbrew/perls/perl-5.14.0'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=undef, use64bitall=undef, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.5.2', 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='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib /usr/lib/i386-linux-gnu /usr/lib64
  libs=-lnsl -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.13'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib
-fstack-protector'

Locally applied patches​:


@​INC for perl 5.14.0​:
  /home/joel/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0/i686-linux
  /home/joel/perl5/perlbrew/perls/perl-5.14.0/lib/site_perl/5.14.0
  /home/joel/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0/i686-linux
  /home/joel/perl5/perlbrew/perls/perl-5.14.0/lib/5.14.0
  .


Environment for perl 5.14.0​:
  HOME=/home/joel
  LANG=en_US.UTF-8
  LANGUAGE=en_US​:en
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/joel/perl5/perlbrew/bin​:/home/joel/perl5/perlbrew/perls/perl-5.14.0/bin​:/home/joel/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games​:/home/joel/Programs/Build/go/bin
  PERLBREW_PATH=/home/joel/perl5/perlbrew/bin​:/home/joel/perl5/perlbrew/perls/perl-5.14.0/bin
  PERLBREW_PERL=perl-5.14.0
  PERLBREW_ROOT=/home/joel/perl5/perlbrew
  PERLBREW_VERSION=0.21
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

From @jkeenan

On Mon Jan 02 11​:04​:15 2012, joel.a.berger@​gmail.com wrote​:

[snip]

---
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
index 094c4cd..9ef48b7 100644
--- a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
+++ b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
@​@​ -24,6 +24,7 @​@​ Make a filehandle. Same kind of idea as
Symbol​::gensym().
sub mkfh()
{
no strict;
+no warnings 'once';
my $fh = \*{$fhname++};
use strict;
return($fh);

Is this really necessary? I get this​:

#####
$ perl -cw dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm syntax OK
#####

In fact, I don't see a case for the 'no strict' there, either. If I
comment it out and say 'perl -cw ', I still get 'syntax OK'.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

From @cpansprout

On Mon Jan 02 17​:33​:48 2012, jkeenan wrote​:

On Mon Jan 02 11​:04​:15 2012, joel.a.berger@​gmail.com wrote​:

[snip]

---
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
index 094c4cd..9ef48b7 100644
--- a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
+++ b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
@​@​ -24,6 +24,7 @​@​ Make a filehandle. Same kind of idea as
Symbol​::gensym().
sub mkfh()
{
no strict;
+no warnings 'once';
my $fh = \*{$fhname++};
use strict;
return($fh);

Is this really necessary? I get this​:

#####
$ perl -cw dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm syntax OK
#####

In fact, I don't see a case for the 'no strict' there, either. If I
comment it out and say 'perl -cw ', I still get 'syntax OK'.

It is a run-time stricture.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

From joel.a.berger@gmail.com

Hi Jim,

I'm not sure what causes it, could be a Devel​::Declare thing, but try
installing my new Module​::UseFrom, warnings abound and I can't seem to
get rid of them any other way. Since I saw that there was a bug filed
on this, I assumed that this problem happened more often.

I guess it doesn't need to be fixed, especially if there is some other
way to prevent the warnings on installing Module​::UseFrom, but it
looks bad as is.

Thanks for any input!

Joel Berger

On Mon, Jan 2, 2012 at 7​:33 PM, James E Keenan via RT
<perlbug-followup@​perl.org> wrote​:

On Mon Jan 02 11​:04​:15 2012, joel.a.berger@​gmail.com wrote​:

[snip]

---
 dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
index 094c4cd..9ef48b7 100644
--- a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
+++ b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
@​@​ -24,6 +24,7 @​@​ Make a filehandle. Same kind of idea as
Symbol​::gensym().
 sub mkfh()
 {
 no strict;
+no warnings 'once';
 my $fh = \*{$fhname++};
 use strict;
 return($fh);

Is this really necessary?  I get this​:

#####
$ perl -cw dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm syntax OK
#####

In fact, I don't see a case for the 'no strict' there, either.  If I
comment it out and say 'perl -cw ', I still get 'syntax OK'.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

From joel.a.berger@gmail.com

The testing reports show that others are seeing the warnings too​:

http​://www.cpantesters.org/distro/M/Module-UseFrom.html#Module-UseFrom-0.01

Cheers,
Joel

On Mon, Jan 2, 2012 at 8​:11 PM, Joel Berger <joel.a.berger@​gmail.com> wrote​:

Hi Jim,

I'm not sure what causes it, could be a Devel​::Declare thing, but try
installing my new Module​::UseFrom, warnings abound and I can't seem to
get rid of them any other way. Since I saw that there was a bug filed
on this, I assumed that this problem happened more often.

I guess it doesn't need to be fixed, especially if there is some other
way to prevent the warnings on installing Module​::UseFrom, but it
looks bad as is.

Thanks for any input!

Joel Berger

On Mon, Jan 2, 2012 at 7​:33 PM, James E Keenan via RT
<perlbug-followup@​perl.org> wrote​:

On Mon Jan 02 11​:04​:15 2012, joel.a.berger@​gmail.com wrote​:

[snip]

---
 dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
index 094c4cd..9ef48b7 100644
--- a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
+++ b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
@​@​ -24,6 +24,7 @​@​ Make a filehandle. Same kind of idea as
Symbol​::gensym().
 sub mkfh()
 {
 no strict;
+no warnings 'once';
 my $fh = \*{$fhname++};
 use strict;
 return($fh);

Is this really necessary?  I get this​:

#####
$ perl -cw dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm syntax OK
#####

In fact, I don't see a case for the 'no strict' there, either.  If I
comment it out and say 'perl -cw ', I still get 'syntax OK'.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

From @jkeenan

On Mon Jan 02 18​:12​:21 2012, joel.a.berger@​gmail.com wrote​:

Hi Jim,

I guess it doesn't need to be fixed, especially if there is some other
way to prevent the warnings on installing Module​::UseFrom, but it
looks bad as is.

Since I somewhat mis-analyzed the problem, I'll defer to Father C. and
the other porters as to whether to apply the patch. Thanks for the
submission!

jimk

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

From @cpansprout

On Mon Jan 02 17​:33​:48 2012, jkeenan wrote​:

On Mon Jan 02 11​:04​:15 2012, joel.a.berger@​gmail.com wrote​:

[snip]

---
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
index 094c4cd..9ef48b7 100644
--- a/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
+++ b/dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
@​@​ -24,6 +24,7 @​@​ Make a filehandle. Same kind of idea as
Symbol​::gensym().
sub mkfh()
{
no strict;
+no warnings 'once';
my $fh = \*{$fhname++};
use strict;
return($fh);

Is this really necessary? I get this​:

#####
$ perl -cw dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm
dist/ExtUtils-Install/lib/ExtUtils/Packlist.pm syntax OK
#####

Thanks to Joel Berger, I’ve learnt something new. The ‘used once’ check
is done once the main program finishes compiling.

So you can trigger the warning like this​:

$ perl -MExtUtils​::Packlist -we 'BEGIN { ExtUtils​::Packlist​::mkfh() }'

I’ve applied the fix (thank you) as a91616b and some tests as
ab7e096.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Jan 3, 2012

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

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

No branches or pull requests

1 participant