On Fri, Jul 15, 2016 at 02:56:05PM -0600, Jerry James wrote:
On Fri, Jul 15, 2016 at 2:49 PM, Jan Kratochvil
<jan.kratochvil(a)redhat.com> wrote:
> I find safer to use -Werror for such kinds of warnings.
Do you keep a list somewhere of which warnings to use with -Werror?
I'm too lazy to keep such a list updated as gcc adds more warnings,
even if I had one to start with. This script is less work. Most
builds I do produce a list of fewer than a dozen items, so I can scan
the list very quickly.
FWIW libvirt & libguestfs use the Gnulib "manywarnings" system to
manage which GCC warnings are enabled and which are ignored. Here is
libvirt's list:
https://libvirt.org/git/?p=libvirt.git;a=blob;f=m4/virt-compile-warnings.m4
Here is libguestfs's list:
https://github.com/libguestfs/libguestfs/blob/master/m4/guestfs_c.m4#L43
In libguestfs we also liberally use '#pragma GCC diagnostic ...' to
turn warnings off for sections of code. This lets us have more
warnings turned on in general, a good compromise when you are
compiling 1¼ million lines of C code.
This isn't directly useful for you since it's an upstream thing and
your mock wrapper is downstream, but I guess it may be interesting as
a reference for the GCC warnings we consider to be useful and others
we consider less than useful.
Here's some documentation about the manywarnings module:
https://www.gnu.org/software/gnulib/manual/html_node/manywarnings.html
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://libguestfs.org