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

Suggesting warning for useless greediness operator #8899

Closed
p5pRT opened this issue May 15, 2007 · 6 comments
Closed

Suggesting warning for useless greediness operator #8899

p5pRT opened this issue May 15, 2007 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented May 15, 2007

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

Searchable as RT42957$

@p5pRT
Copy link
Author

p5pRT commented May 15, 2007

From perlbug@jan-o-sch.net

Created by perlbug@jan-o-sch.net

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).

Perl Info

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

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 2012

From @jkeenan

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

@p5pRT
Copy link
Author

p5pRT commented Aug 13, 2012

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

@p5pRT
Copy link
Author

p5pRT commented Jan 13, 2013

From @khwilliamson

Yes, I'll look at it

--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Dec 25, 2013

From @khwilliamson

This was added in commit 4fa6dd1 several weeks ago, and there have been no complaints yet
--
Karl Williamson

@p5pRT p5pRT closed this as completed Dec 25, 2013
@p5pRT
Copy link
Author

p5pRT commented Dec 25, 2013

@khwilliamson - 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