Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Compiler warning without line number

by QM (Vicar)
on Feb 02, 2008 at 17:16 UTC ( #665749=perlquestion: print w/ replies, xml ) Need Help??
QM has asked for the wisdom of the Perl Monks concerning the following question:

I have some defective code, which on one version of Perl doesn't emit a line number:
#!/your/perl/here use strict; use warnings; my $x = q/Just Another Perl Hacker/; if ($x =~ m/(?The Purl Caretakers' John)/) { print "Anagram Regex?\n"; } exit;
(The (? should be (?:.)

On a Linux build of 5.8.0:

Linux% perl -c 665749.pl Sequence (?T...) not recognized in regex; marked by <-- HERE in m/(?T +<-- HERE he Purl Caretakers' John)/
Of course, this is easy to find, as it's a short program. But it doesn't list the offending file (or module), so it may be more difficult to find in a real application.

For comparison, here's ActiveState's 5.8.8:

Windows XP>perl -c 665749.pl Sequence (?T...) not recognized in regex; marked by <-- HERE in m/(?T +<-- HERE he Purl Caretakers' John)/ at 665749.pl line 8.

The full Linux build info:

Linux% perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuratio +n: Platform: osname=linux, osvers=2.4.21-25.elsmp, archname=i386-linux-thread-m +ulti uname='linux porky.build.redhat.com 2.4.21-25.elsmp #1 smp fri nov + 12 21:34:51 est 2004 i686 i686 i386 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -march=i386 -mcpu=i686 - +Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red + Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefi +x=/usr -Dsiteprefix=/usr -Dotherlibdirs=/usr/lib/perl5/5.8.0 -Duseshr +plib -Duse hreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_d +b -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio - +Dinstallus binperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemulti +plicity=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 + -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_S +OURCE -D_F LE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -g -pipe -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGI +NG -fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm' ccversion='', gccversion='3.2.3 20030502 (Red Hat Linux 3.2.3-54)' +, gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=1 +2 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', + lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.s +o gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynami +c -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY USE_ITHREADS USE_LARGE_ +FILES PERL_IMPLICIT_CONTEXT Locally applied patches: MAINT18379 Built under linux Compiled at Dec 13 2005 16:27:05 %ENV: PERL5LIB="/home/somebody/perl/lib" @INC: /home/somebody/perl/lib/i386-linux-thread-multi /home/somebody/perl/lib /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .

Is this a known problem with 5.8.0? I did a search, but I don't think I can say with confidence that this issue hasn't been raised somewhere.

Update: In the original post, I replaced the shebang section with something simpler, which changed the actual line number reported. I've updated the error message to reflect the actual code posted.

-QM
--
Quantum Mechanics: The dreams stuff is made of

Comment on Compiler warning without line number
Select or Download Code
Re: Compiler warning without line number
by superfrink (Curate) on Feb 03, 2008 at 00:18 UTC
    I don't know the answer but 5.8.4 and 5.8.8 seem okay. On Fedora 6:
    $ perl asdf.pl Sequence (?T...) not recognized in regex; marked by <-- HERE in m/(?T +<-- HERE he Purl Caretakers' John)/ at asdf line 8. $ perl -v This is perl, v5.8.8 built for i386-linux-thread-multi
    On Slackware 10.0:
    [chad@thepurplebuffalo ~]$ perl asdf Sequence (?T...) not recognized in regex; marked by <-- HERE in m/(?T +<-- HERE he Purl Caretakers' John)/ at asdf line 8. [chad@thepurplebuffalo ~]$ perl -v This is perl, v5.8.4 built for i486-linux
Re: Compiler warning without line number
by syphilis (Canon) on Feb 03, 2008 at 00:23 UTC
    Is this a known problem with 5.8.0?

    I get the same as you with ActiveState's 5.8.8, but ActiveState's 5.8.0 omits the line number (same as 5.8.0 on linux).

    We're left to conclude that either it *was* a known issue, or that it was fixed accidentally :-)

    Cheers,
    Rob
Re: Compiler warning without line number
by Util (Priest) on Feb 03, 2008 at 00:35 UTC

    On OS X, I verified that the problem existed in Perl 5.8.0 and 5.8.1, and was fixed in 5.8.2.
    Here are the relevant parts of the 5.8.2 changelog, and the P5P messages:

    http://www.nntp.perl.org/group/perl.perl5.porters/2003/10/msg84468.html

    From: Slaven Rezic
    Date: October 31, 2003 04:24
    Subject: [PATCH] Off-by-one error in regcomp.c
    In regexp error messages, file and line are not printed due to
    an off-by-one error in regcomp.c. This patch fixes the problem
    --snip--
    --- regcomp.c.orig 2003-10-31 13:07:52.000000000 +0100 +++ regcomp.c 2003-10-31 13:08:07.000000000 +0100 @@ -5045,7 +5045,7 @@ S_re_croak2(pTHX_ const char* pat1,const if (l1 > 512) l1 = 512; Copy(message, buf, l1 , char); - buf[l1] = '\0'; /* Overwrite \n */ + buf[l1-1] = '\0'; /* Overwrite \n */ Perl_croak(aTHX_ "%s", buf); }
    --snip--
    http://www.nntp.perl.org/group/perl.perl5.porters/2003/10/msg84501.html
    Thanks, applied as change #21591.
    http://search.cpan.org/src/NWCLARK/perl-5.8.2/Changes
    [ 21606] By: nicholas on 2003/11/01 14:58:31 Log: Integrate: [ 21591] Subject: [PATCH] Off-by-one error in regcomp.c From: Slaven Rezic <slaven@rezic.de> Date: Fri, 31 Oct 2003 12:16:11 +0000 Message-Id: <1067602571.12768@devpc01.iconmobile.de> [ 21593] Test nit ; goes with change 21591 Branch: maint-5.8/perl !> regcomp.c t/lib/warnings/regcomp t/op/regmesg.t

      Thanks, I'm glad to see it's fixed. Maybe I can get the admin to update this installation. I'm sure there's a few more fixes like this I'll wander into.

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

        Not to say that 5.8.0 was a bad release, but bumping up to at least 5.8.1 should bring you a bunch of bug fixes that crept into 5.8.0 release. Of course, the 5.8.2 release with patch above was released over four years ago.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://665749]
Approved by ww
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-08-01 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls