develooper Front page | perl.perl5.porters | Postings from January 2008

Re: gcc -pedantic is a mixed blessing

Thread Previous | Thread Next
Nicholas Clark
January 2, 2008 14:29
Re: gcc -pedantic is a mixed blessing
Message ID:
On Wed, Dec 26, 2007 at 08:05:08AM -0500, Jarkko Hietaniemi wrote:
> Nicholas Clark wrote:
> > I'm not convinced that changing to adding -pedantic to the gcc flags whenever
> > we can is a great thing. (Looks to be change 28914:
> >
> > )
> > 
> > Specifically because it then defines PERL_GCC_PEDANTIC:
> > 
> > +*-pedantic*) warn="$warn -DPERL_GCC_PEDANTIC" ;
> > 
> > which in turn disables a lot of inlining macros for gcc, which in turn will
> > hurt performance.
> Oh I hate thee gcc, let me count the ways...
> > (And right now is hurting my debugging, because they also have a lot of
> > assert()s which I've just realised aren't checking up on me)
> > 
> > I'm not sure of what is the best thing to suggest here, as I'd rather like
> > the pedantic compile checking during test builds (and being generous, I'd like
> > to share the joy with everyone else smoking perl) but I'd also like to share
> Turn -pedantic on only for -g/debugging builds?

I don't know.

I suspect that it's not that useful for optimised builds, as most non-porters
building Perl for installation won't pay that much attention to the extra
warning messages it causes, hence it's not a great thing as a default for
optimised builds.

But for debugging builds I also would somewhat like it to be the default at
it adds lots of blocks with assertions, that catch logic errors.

Quite unintentionally I committed a change to remove it from cflags.SH as
part of change 32804, because I had made that change locally during
development work on making REGEXPs SVs (to get the assertions) and forgot
to remove it from the list of files committed as part of that change.

This wasn't meant to forestall debate, rather to point out that currently
things are not the way they were when this threads started.

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About