develooper Front page | perl.perl5.porters | Postings from November 2014

Re: Avoid gcc warning op.c

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
November 15, 2014 19:26
Subject:
Re: Avoid gcc warning op.c
Message ID:
20141115192630.12287.qmail@lists-nntp.develooper.com
Martijn Lievaart wrote:
> Hi,
> 
> First post to this mailing list and first stab at fighting the warnings. 
> Please flame me if anything is inappropriate.

Please use 'git format-patch' or 'git show --pretty=email', rather
than 'git show'.  And please attach the patch, rather than inlining it
(or do both).  Some e-mail programs corrupt inline patches.

Also, it's preferable to send patches to perlbug@perl.org, so they are
less likely to be forgotten.

> Questions
> - Is micro optimising here needed? Looking at the original code suggests 
> it is.

We try to squeeze every ounce of speed out of perl, so that means
micro-optimisation is acceptable and even welcomed.  But maintainabil-
ity still trumps micro-optimisation.

> - Is this patch the correct way to address these kinds of warnings?

It's one way, and it's fine.  If you ask three people on this list,
you'll get 4 of 5 answers. :-)

> 
> TIA,
> Martijn M4 Lievaart
> 
> Author: Martijn Lievaart <m@rtij.nl>
> Date:   Sat Nov 15 17:51:44 2014 +0100
> 
>     Avoid gcc warning "‘start’ may be used uninitialized in this function"
> 
> diff --git a/op.c b/op.c
> index 8a0c7fa..46b0420 100644
> --- a/op.c
> +++ b/op.c
> @@ -7937,14 +7937,14 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, 
> OP *attrs, OP *block)

Here is one place where your mailer (presumably) wrapped a long line,
corrupting the patch.


Thread Previous | Thread Next


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