On Wed, May 25, 2005 at 07:36:33 +1000, Erik de Castro Lopo wrote:
> Jamie Honan wrote:
> 
> > On Tue, May 24, 2005 at 10:41:27PM +1000, Erik de Castro Lopo wrote:
> > > If -Wshadow catches on single bug its worth living with or 
> > > rather working around any spurious warnings.
> > > 
> > > I wouldn't cut C code without it.
> > 
> > Erik, what are the warnings you regularly use?
> 
> For libsndfile the configure script chack to see if the compiler
> is GCC and if it is turns on the following:
> 
>      -W -Wall -Wstrict-prototypes -Wmissing-prototypes
>      -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs
>      -Wshadow -Wbad-function-cast -Wwrite-strings

I do something similar, but my list of warnings is slightly different:

    -Wall -W -Wpointer-arith -Wfloat-equal -Wcast-align -Wcast-qual
    -Waggregate-return -Wredundant-decls -Wshadow -Wwrite-strings
    -Wno-unused-parameter -Wundef -Wmissing-declarations
    -Wstrict-prototypes -std=c99 -Wmissing-prototypes

and for C++ I use:

    -Wall -W -Wpointer-arith -Wfloat-equal -Wcast-align -Wcast-qual
    -Waggregate-return -Wno-unused-parameter -Wreorder
    -Wctor-dtor-privacy -Wnon-virtual-dtor -Wno-non-template-friend

And I always try to fix warnings when they appear so that my code
compiles without generating any if possible, then any new warnings stand
out and don't become lost in the noise.


Cheers,

John
-- 
Everybody's entitled to an opinion. But nobody's entitled to be taken
seriously.
            -- Dan Rutter, http://www.dansdata.com/gz006.htm
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to