You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by "Philip M. Gollucci" <pg...@p6m7g8.com> on 2005/08/09 05:15:31 UTC
bugs_build TODO completed -Wdeclaration-after-statement
All,
Can I have some +/- 1s please ? :)
Patch attached.
I'll confirm this "works" on at least the following:
FreeBSD 5.4-RELEASE
FreeBSD 6.0-BETA2
FreeBSD 7.0-CURRENT
and
Linux 2.4.21-15.EL #1 i686 i686 i386 GNU/Linux
with perl 5.8.7 and latest SVN of mp2.
--
END
------------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Nikolay Ananiev wrote:
> I think this is not good, because it won't catch 3.4.1.
> Maybe this is better:
>
> if ($maj . $min . $patch >= 332) {
> $ccopts .= " -Wdeclaration-after-statement";
> }
Good catch. I'll attempt round three at some point later tonight (EST).
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by Nikolay Ananiev <ha...@3dzone-bg.com>.
"Philip M. Gollucci" <pg...@p6m7g8.com> wrote in message
news:42F97DA0.7000607@p6m7g8.com...
> Revised:
>
> Index: Build.pm
>[...]
> + ## GCC 3.3.2+
> + if ($gcc_major >= 3 && $gcc_minor >= 3 &&
> + $gcc_patch >= 2) {
> + $ccopts .= " -Wdeclaration-after-statement";
> + }
> }
> }
>
I think this is not good, because it won't catch 3.4.1.
Maybe this is better:
if ($maj . $min . $patch >= 332) {
$ccopts .= " -Wdeclaration-after-statement";
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Revised:
Index: Build.pm
===================================================================
--- Build.pm (revision 230957)
+++ Build.pm (working copy)
@@ -518,10 +518,20 @@
if ($self->{MP_MAINTAINER}) {
$self->{MP_DEBUG} = 1;
- if ($self->perl_config('gccversion')) {
+
+ if (my $gccversion = $self->perl_config('gccversion')) {
#same as --with-maintainter-mode
$ccopts .= " $Wall -DAP_DEBUG";
$ccopts .= " -DAP_HAVE_DESIGNATED_INITIALIZER";
+
+ my ($gcc_major, $gcc_minor, $gcc_patch) =
+ $gccversion =~ /^(\d)\.(\d+)\.(\d+)/;
+
+ ## GCC 3.3.2+
+ if ($gcc_major >= 3 && $gcc_minor >= 3 &&
+ $gcc_patch >= 2) {
+ $ccopts .= " -Wdeclaration-after-statement";
+ }
}
}
--
END
------------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> In that case, wouldn't the split /\./, $gccversion form be sufficient ?
I need a vaction.
--
END
---------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Philip M. Gollucci wrote:
> Philippe M. Chiasson wrote:
>
>> Isn't that my ^^^ redundant ?
>
> YES. You would have thought I would have gotten a warning from perl.
>
>> I suspect the version parsing could be simplified to something
>> more explicit like this :
>
> I do too, but I'm not that familiar with GCC version numbers. Is there
> never a case where its i.e.: 3.0 or 3?
In that case, wouldn't the split /\./, $gccversion form be sufficient ?
>> my ($maj, $min, $patch) = $gccversion =~ /^(\d+)\.(\d+)\.(\d+)/;
>> or
>> my ($maj, $min, $patch) = split /\./, $gccversion;
>>
>> #Gcc 3.3.2 and higher
>> if ($maj >= 3 && $min >= 3 && $patch >= 2) {
>> $ccopts .= " -Wdeclaration-after-statement";
>> }
>
>
--
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Philippe M. Chiasson wrote:
> Isn't that my ^^^ redundant ?
YES. You would have thought I would have gotten a warning from perl.
> I suspect the version parsing could be simplified to something
> more explicit like this :
I do too, but I'm not that familiar with GCC version numbers. Is there
never a case where its i.e.: 3.0 or 3?
> my ($maj, $min, $patch) = $gccversion =~ /^(\d+)\.(\d+)\.(\d+)/;
> or
> my ($maj, $min, $patch) = split /\./, $gccversion;
>
> #Gcc 3.3.2 and higher
> if ($maj >= 3 && $min >= 3 && $patch >= 2) {
> $ccopts .= " -Wdeclaration-after-statement";
> }
--
END
---------------------------------------------------------
What doesn't kill us can only make us stronger.
Nothing is impossible.
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com
http://www.liquidation.com
http://www.uksurplus.com
http://www.govliquidation.com
http://www.gowholesale.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: bugs_build TODO completed -Wdeclaration-after-statement
Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Philip M. Gollucci wrote:
> All,
>
> Can I have some +/- 1s please ? :)
>
> Patch attached.
>
> I'll confirm this "works" on at least the following:
> FreeBSD 5.4-RELEASE
> FreeBSD 6.0-BETA2
> FreeBSD 7.0-CURRENT
>
> and
>
> Linux 2.4.21-15.EL #1 i686 i686 i386 GNU/Linux
>
> with perl 5.8.7 and latest SVN of mp2.
>
>
> [...]
> Index: lib/Apache2/Build.pm
> ===================================================================
> --- lib/Apache2/Build.pm (revision 230957)
> +++ lib/Apache2/Build.pm (working copy)
> @@ -518,10 +518,22 @@
>
> if ($self->{MP_MAINTAINER}) {
> $self->{MP_DEBUG} = 1;
> - if ($self->perl_config('gccversion')) {
> +
> + my $gccversion;
Isn't that my ^^^ redundant ?
> + if (my $gccversion = $self->perl_config('gccversion')) {
> #same as --with-maintainter-mode
> $ccopts .= " $Wall -DAP_DEBUG";
> $ccopts .= " -DAP_HAVE_DESIGNATED_INITIALIZER";
> +
> + $gccversion =~ /^(.*?)\s/;
> + $gccversion = $1;
> + $gccversion =~ s/\D//g;
> +
> + $gccversion = $gccversion . "0" if length $gccversion < 3;
> +
> + if ($gccversion >= 332) {
> + $ccopts .= " -Wdeclaration-after-statement";
> + }
> }
> }
I suspect the version parsing could be simplified to something
more explicit like this :
my ($maj, $min, $patch) = $gccversion =~ /^(\d+)\.(\d+)\.(\d+)/;
or
my ($maj, $min, $patch) = split /\./, $gccversion;
#Gcc 3.3.2 and higher
if ($maj >= 3 && $min >= 3 && $patch >= 2) {
$ccopts .= " -Wdeclaration-after-statement";
}
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5