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

warnings::warnif is sometimes ignored.. #8559

Open
p5pRT opened this issue Aug 10, 2006 · 3 comments
Open

warnings::warnif is sometimes ignored.. #8559

p5pRT opened this issue Aug 10, 2006 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 10, 2006

Migrated from rt.perl.org#40144 (status was 'open')

Searchable as RT40144$

@p5pRT
Copy link
Author

p5pRT commented Aug 10, 2006

From wiles@modarnis.com

Created by wiles@modarnis.com

I expect the code below to print​:

  Saw me. at ./perl_warnings_fails line 36
  Killed me. at ./perl_warnings_fails line 40

In fact, the "Fatal" is ignored and I get​:

  Saw me. at ./perl_warnings_fails line 36
  Killed me. at ./perl_warnings_fails line 40
  Revenge from beyond the grave! at ./perl_warnings_fails line 43
  Out of the function. at ./perl_warnings_fails line 48

If I uncomment "my $y = \@​_;" it works as expected. There is nothing
special about $y. "print \@​_;" also masks the bug.

I know it's in 5.8.7 and have been told it's in in 5.8.8 and bleadperl
(5.9.4). It's also in an unknown version of a Microsoft port.

#!/usr/bin/perl

package Foo;
use strict;
use warnings​::register;

sub new
{
  my ($class_name) = @​_;

  my $instance = { };
  bless $instance, $class_name;

  return $instance;
}

sub warnme($$)
{
  my ($self, $text) = @​_;

  warnings​::warnif($self, $text);
}

1;

package main;
use strict;
use warnings;

sub wtest($)
{
  my $f = shift;

  #my $y = \@​_;

  $f->warnme('Saw me.');

  {
  use warnings FATAL => 'Foo';
  $f->warnme('Killed me.');
  }

  $f->warnme('Revenge from beyond the grave!');
}

my $g = Foo->new;
wtest($g);
$g->warnme('Out of the function.');

Perl Info

Flags:
    category=library
    severity=high

Site configuration information for perl v5.8.7:

Configured by root at Wed Jul 13 12:01:19 PDT 2005.

Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
  Platform:
    osname=linux, osvers=2.4.31, archname=i486-linux
    uname='linux midas 2.4.31 #6 sun jun 5 19:04:47 pdt 2005 i686 unknown unknown gnulinux '
    config_args='-de -Dprefix=/usr -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Doptimize=-O2 -march=i486 -mcpu=i686 -Dinc_version_list=5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 -Darchname=i486-linux'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef 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 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -march=i486 -mcpu=i686',
    cppflags='-fno-strict-aliasing -pipe -I/usr/local/include'
    ccversion='', gccversion='3.3.6', 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 =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl v5.8.7:
    /usr/lib/perl5/5.8.7/i486-linux
    /usr/lib/perl5/5.8.7
    /usr/lib/perl5/site_perl/5.8.7/i486-linux
    /usr/lib/perl5/site_perl/5.8.7
    /usr/lib/perl5/site_perl
    .


Environment for perl v5.8.7:
    HOME=/home/wiles
    LANG=en_US
    LANGUAGE (unset)
    LC_COLLATE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/wiles/bin:/home/narky/bin:/usr/local/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/usr/bin:/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2006

From @rgs

This bug is a side-effect of a problem with the behaviour of @​DB​::args
as described here :

http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2004-12/msg00120.html

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2006

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

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

2 participants