[Spice-devel] [PATCH] m4: WARN FLAGS: Drop -Wenum-compare

Christophe Fergeau cfergeau at redhat.com
Mon Feb 16 01:10:41 PST 2015


On Sun, Feb 15, 2015 at 09:00:01PM +0200, Uri Lublin wrote:
> It's "C++ and Objective-C++ only" (from man gcc) and

https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html#Warning-Options
says " In C this warning is enabled by -Wall." so this is no longer
true.
libvirt-glib/m4/virt-compile-warnings.m4 (where
spice-compile-warnings.m4 is coming from iirc) has:

# gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall
dontwarn="$dontwarn -Wenum-compare"

so ACK to the general idea in this patch. Would be nice if you could
adjust the commit message and pick the comment from
virt-compile-warnings.m4 though :)

Christophe


> My RHEL-6 gcc (4.4.7) complains a lot about it:
>    cc1: warning: command line option "-Wenum-compare" is
>    valid for C++/ObjC++ but not for C
> ---
>  m4/spice-compile-warnings.m4 |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/m4/spice-compile-warnings.m4 b/m4/spice-compile-warnings.m4
> index 31f2a9c..c42e351 100644
> --- a/m4/spice-compile-warnings.m4
> +++ b/m4/spice-compile-warnings.m4
> @@ -23,6 +23,7 @@ AC_DEFUN([SPICE_COMPILE_WARNINGS],[
>      dontwarn="$dontwarn -Wc++-compat"
>      dontwarn="$dontwarn -Wabi"
>      dontwarn="$dontwarn -Wdeprecated"
> +    dontwarn="$dontwarn -Wenum-compare"
>      # Don't care about ancient C standard compat
>      dontwarn="$dontwarn -Wtraditional"
>      # Don't care about ancient C standard compat
> -- 
> 1.7.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150216/c5fb922a/attachment.sig>


More information about the Spice-devel mailing list