develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #42957] Suggesting warning for useless greediness operator

From:
James E Keenan via RT
Date:
August 13, 2012 16:55
Subject:
[perl #42957] Suggesting warning for useless greediness operator
Message ID:
rt-3.6.HEAD-11172-1344902139-526.42957-15-0@perl.org
On Tue May 15 09:20:17 2007, perlbug@jan-o-sch.net wrote:
> This is a bug report for perl from perlbug@jan-o-sch.net,
> generated with the help of perlbug 1.35 running under perl v5.8.8.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> There is no useful application for using the greediness modifier in a
> regular expression after a quantifier which enforces a constant number
> of occurences, e.g.: /ab{3}?c/. That could easily be confused with
> /a(b{3})?c/ to express "zero or three times 'b'". I suggest printing a
> warning message in case of a useless quantifier like in the example
> above (at least with perl -W, if not with -w, already).
> 
> [Please do not change anything below this line]

Reviewing older tickets this evening, I came across this feature request.

Is there any interest in implementing it?

Thank you very much.
Jim Keenan
> -----------------------------------------------------------------
> ---
> Flags:
>     category=core
>     severity=wishlist
> ---
> Site configuration information for perl v5.8.8:
> 
> Configured by Gentoo at Sat Feb  3 16:54:11 CET 2007.
> 
> Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
>   Platform:
>     osname=linux, osvers=2.6.19-gentoo-r5, archname=i686-linux-thread-
>    multi
>     uname='linux jhp 2.6.19-gentoo-r5 #1 smp preempt tue jan 30
>    12:36:14
> cet 2007 i686 intel(r) core(tm)2 cpu t7200 @ 2.00ghz genuineintel
>    gnulinux '
>     config_args='-des -Darchname=i686-linux-thread -Dcccdlflags=-fPIC
> -Dccdlflags=-rdynamic -Dcc=i686-pc-linux-gnu-gcc -Dprefix=/usr
> -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=  -Doptimize=-O2
> -march=pentium-m -pipe -fomit-frame-pointer -msse3 -mfpmath=sse
> -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin
> -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3
> -Dinstallman1dir=/usr/share/man/man1
> -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm
> -Dinc_version_list=5.8.0 5.8.0/i686-linux-thread-multi 5.8.2
> 5.8.2/i686-linux-thread-multi 5.8.4 5.8.4/i686-linux-thread-multi
>    5.8.5
> 5.8.5/i686-linux-thread-multi 5.8.6 5.8.6/i686-linux-thread-multi
>    5.8.7
> 5.8.7/i686-linux-thread-multi  -Dinc_version_list=5.8.0
> 5.8.0/i686-linux-thread-multi 5.8.2 5.8.2/i686-linux-thread-multi
>    5.8.4
> 5.8.4/i686-linux-thread-multi 5.8.5 5.8.5/i686-linux-thread-multi
>    5.8.6
> 5.8.6/i686-linux-thread-multi 5.8.7 5.8.7/i686-linux-thread-multi
> -Dcf_by=Gentoo -Ud_csh -Dusenm -Dusethreads -Di_ndbm -Di_gdbm -Ui_db'
>     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='i686-pc-linux-gnu-gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
> -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe
> -Wdeclaration-after-statement -D_LARGEFILE_SOURCE
>    -D_FILE_OFFSET_BITS=64
> -I/usr/include/gdbm',
>     optimize='-O2 -march=pentium-m -pipe -fomit-frame-pointer -msse3
> -mfpmath=sse',
>     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
> -fno-strict-aliasing -pipe -Wdeclaration-after-statement
> -I/usr/include/gdbm'
>     ccversion='', gccversion='4.1.1 (Gentoo 4.1.1-r3)',
>    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='i686-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib'
>     libpth=/usr/local/lib /lib /usr/lib
>     libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
>     perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
>     libc=/lib/libc-2.4.so, so=so, useshrplib=false, libperl=libperl.a
>     gnulibc_version='2.4'
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-
>    rdynamic'
>     cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
> 
> Locally applied patches:
> 
> 
> ---
> @INC for perl v5.8.8:
>     /etc/perl
>     /usr/lib/perl5/vendor_perl/5.8.8/i686-linux-thread-multi
>     /usr/lib/perl5/vendor_perl/5.8.8
>     /usr/lib/perl5/vendor_perl
>     /usr/lib/perl5/site_perl/5.8.8/i686-linux-thread-multi
>     /usr/lib/perl5/site_perl/5.8.8
>     /usr/lib/perl5/site_perl
>     /usr/lib/perl5/5.8.8/i686-linux-thread-multi
>     /usr/lib/perl5/5.8.8
>     /usr/local/lib/site_perl
>     .
> 
> ---
> Environment for perl v5.8.8:
>     HOME=/home/jan
>     LANG=en_US
>     LANGUAGE (unset)
>     LC_ADDRESS=de_DE@euro
>     LC_COLLATE=de_DE@euro
>     LC_MEASUREMENT=de_DE@euro
>     LC_MONETARY=de_DE@euro
>     LC_NAME=de_DE@euro
>     LC_NUMERIC=de_DE@euro
>     LC_PAPER=de_DE@euro
>     LC_TELEPHONE=de_DE@euro
>     LC_TIME=de_DE@euro
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
> 
> PATH=/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-
>    bin/4.1.1:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/opt/blackdown-jdk-
>    1.4.2.03/bin:/opt/blackdown-jdk-
>   
1.4.2.03/jre/bin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin:/opt/vmware/server/console/bin
>     PERL_BADLANG (unset)
>     SHELL=/bin/bash




---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=42957



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About