develooper Front page | perl.perl5.porters | Postings from February 2007

Re: [PATCH #30145] - fix up some warnings (was Re: Future Perl development)

From:
demerphq
Date:
February 7, 2007 12:54
Subject:
Re: [PATCH #30145] - fix up some warnings (was Re: Future Perl development)
Message ID:
9b18b3110702071253o6ed7d707nc738bddc18529b4b@mail.gmail.com
On 2/7/07, Jonathan Stowe <jns@gellyfish.com> wrote:
> On Wed, 2007-02-07 at 10:11 +0000, hv@crypt.org wrote:
> > Nicholas Clark <nick@ccl4.org> wrote:
> > :would you all be so kind as to download this snapshot [...]
> >
> > All tests successful.
> > u=4.72  s=1.25  cu=259.65  cs=26.95  scripts=959  tests=122092
> > make[2]: Leaving directory `/src/package/lang/perl/perl-30145'
> > make[1]: Leaving directory `/src/package/lang/perl/perl-30145'
> >
> > I haven't built maint for a while, and I notice a number of compile-time
> > warnings I don't recognise. (This may also be due to upgrading to gcc 4.1.x.)
>
> This fixes some of the ones I'm seeing.
[...]
> diff -ru perl-30145/mg.c perl-30145.new/mg.c
> --- perl-30145/mg.c     2007-02-05 22:26:27.000000000 +0000
> +++ perl-30145.new/mg.c 2007-02-07 13:59:33.000000000 +0000
> @@ -503,8 +503,8 @@
>                 I32 paren = rx->lastparen;
>
>                 /* return the last filled */
> -               while ( paren >= 0 &&
> -                   rx->startp[paren] == -1 || rx->endp[paren] == -1)
> +               while ( (paren >= 0 &&
> +                   rx->startp[paren] == -1) || rx->endp[paren] == -1)
>                 paren--;
>                 return (U32)paren;
>             }

Im thinking that probably is wrong. Doesn't it mean that paren can go
negative in the loop?

And checking, in blead (not sure from what patch) we now have:

		while ( paren >= 0
			&& (rx->startp[paren] == -1 || rx->endp[paren] == -1) )

Naughty code actually, I really wish all the regexp related "helper
code" could be moved into a single file. The stuff that represents the
public interface should be isolated so its maintainable. Not sure if
its feasable tho given the changelog issues.

cheers,
Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



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