On Mon, 11 Apr 2005 11:15:44 +0100, Tim Bunce <[EMAIL PROTECTED]> wrote:
> On Sun, Apr 10, 2005 at 05:03:58PM -0500, Andy Lester wrote:
> > Attached is a patch that does for DBI what I've been doing in the Perl
> > core the past few weeks:
> >
> > * Apply const qualifiers where possible
> > * Localize auto variables to internal blocks where possible
> > * Clean up complaints from high-stress GCC compiler warnings.
> >
> > I've been building by using this set of changes to Makefile.PL, which
> > makes GCC pretty picky:
> >
> > Index: Makefile.PL
> > ===================================================================
> > --- Makefile.PL (.../DBI-1.48) (revision 17)
> > +++ Makefile.PL (.../trunk) (revision 17)
> > @@ -127,6 +127,7 @@
> > VERSION_FROM=> 'DBI.pm',
> > PREREQ_PM => { "Test::Simple" => 0.40 },
> > EXE_FILES => [ "dbiproxy$ext_pl", "dbiprof$ext_pl" ],
> > + CCFLAGS =>'-DDEBUGGING -DPERL_GCC_PEDANTIC -ansi -pedantic -W
> > -Wno-sign-compare -Wall -Wno-cast-qual -Wpointer-arith
> > -Wmissing-prototypes -Wmissing-noreturn -Wdisabled-optimization
> > -Wbad-function-cast',
> > DIR => [ ],
> > dynamic_lib => { OTHERLDFLAGS => "$::opt_g" },
> > clean => { FILES=> "\$(DISTVNAME) Perl.xsi t/zv*_*.t"
> >
> > Is this patch something you find useful? If so, I can keep digging.
>
> Sure, so long as it'll still build fine with other compilers.
> (So that CCFLAGS line can't be left as-is :)
FYI, I had to re-read the message again too. The `patch' above on Makefile.PL
was not part of the suggested patch, but merely to show what he used to get to
the patch itself.
> > This is just from blowing through this for a couple of hours this
> > afternoon.
>
> Great. Did adding consts actually find any bugs?
In perl-current it did. Not big one's, but it did.
> I've applied the patch (change #970) and make a few tweaks. I needed to
> add a 'const char *' entry to the typemap file for Perl 5.6. I've also
> reworked the way gcc flags get set and enabled more of them by default.
>
> Thanks again Andy.
>
> dbi-dev'ers - I'd be grateful if anyone on slightly unusual platforms
> (including Win32 :) could test the current code in svn to see if
> anything upsets your compiler. Thanks.
--
H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using Perl 5.6.2, 5.8.0, 5.8.5, & 5.9.2 on HP-UX 10.20, 11.00 & 11.11,
AIX 4.3 & 5.2, SuSE 9.1 & 9.2, and Cygwin. http://www.cmve.net/~merijn
Smoking perl: http://www.test-smoke.org, perl QA: http://qa.perl.org
reports to: [EMAIL PROTECTED], [email protected]