[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."

From: Kaveh R. GHAZI
Subject: Re: changing "configure" to default to "gcc -g -O2 -fwrapv ..."
Date: Sat, 30 Dec 2006 13:30:59 -0500 (EST)

On Sat, 30 Dec 2006, Bernd Schmidt wrote:

> Paul Eggert wrote:
> > "Richard Guenther" <address@hidden> writes:
> >
> >> Authors of the affected programs should adjust their makefiles
> >
> > That is what the proposed patch is for.  It gives a way for
> > developers to adjust their makefiles.
> >
> > A developer of portable software cannot simply put something
> > like this into a makefile:
> >
> >   CFLAGS = -g -O2 -fwrapv
> >
> > as -fwrapv won't work with most other compilers.  So the
> > developer needs some Autoconfish help anyway, to address the
> > problem.  The proposed help is only rudimentary, but it does
> > adjust makefiles to address the issue, and it's better than
> > nothing.  Further improvements would of course be welcome.
> So rather than changing the default to -fwrapv for all programs, which I
> would find most unwelcome, how about adding a macro
> which could add -fwrapv and maybe -fno-strict-aliasing if the compiler
> supports them?  Then anyone who knows their program is affected, or is
> just worried that it might be, could add that macro to their
> Bernd

I support this approach in general over one that uses -fwrapv by default.
The macro name is a little inflamatory though.  :-)

I'd like to see a -Warning flag added to GCC to spot places where GCC does
something potentially too aggressive.  Having that would do two things, it
would make it easier for maintainers to audit their code, and it would
make it easier for us to get hard data on how often code will break.
There has been too much guessing and extrapolating in this discussion so
far IMHO.

Such a flag has been already suggested more than once.  Here are two cases
I found without trying too hard.

Is there some technical reason why we can't do this like we did for
-Wstrict-aliasing?  Would we get a zillion false positives?

Kaveh R. Ghazi                  address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]