Add lots of warning flags to CFLAGS [was Re: [Libvir] Remote patch, 2007-02-28]

Mark McLoughlin markmc at redhat.com
Thu Mar 1 16:06:48 UTC 2007


On Thu, 2007-03-01 at 12:20 +0000, Mark McLoughlin wrote:

> >  dnl
> >  dnl make CFLAGS very pedantic at least during the devel phase for everybody
> > +dnl (Overriding $CFLAGS here is very wrong.  See discussion of AM_CFLAGS
> > +dnl in the automake info. - RWMJ)
> >  dnl
> >      if test "${GCC}" = "yes" ; then
> >         CFLAGS="-g -O -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall"
> 
> 	I'll fix this ... patch incoming soon.

	Okay, here's a patch which adds a LIBVIRT_COMPILE_WARNINGS autoconf
macro from GNOME which I've always found very, very useful.

	I've changed it to include all the flags we were using.

	The brilliant thing about this is that you can choose, while hacking,
to build with --enable-compile-warnings=error if you want to use -Werror
to catch any warnings you've introduced.

Cheers,
Mark.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-compile-warnings.patch
Type: text/x-patch
Size: 7020 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070301/19c9050f/attachment-0001.bin>


More information about the libvir-list mailing list