[Top][All Lists]

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

Re: [PATCH] warnings: check -Wfoo rather than -Wno-foo

From: Christophe Fergeau
Subject: Re: [PATCH] warnings: check -Wfoo rather than -Wno-foo
Date: Mon, 19 Aug 2013 10:40:13 +0200
User-agent: Mutt/1.5.21 (2010-09-15)


On Wed, Aug 14, 2013 at 05:33:07PM -0600, Eric Blake wrote:
> As reported by Christophe Fergeau and others, use of the
> warnings modules is awkward when probing for negative
> warning flags.  For example, clang recognizes
> -Wno-unused-command-line-argument, but gcc does not;
> gcc silently ignores unknown warnings in isolation, but when
> something else also causes a compilation problem, gcc then
> compounds the overall message by also complaining about the
> unrecongized command line option at that time.  The gcc manual
> documents that this behavior is intentional so that someone
> can add a -Wno-foo silencer to CFLAGS for a warning that older
> gcc does not understand, and where the warning is undesired
> under newer gcc; it also documents that probing for the -Wfoo
> positive form of the error is a reliable way to tell if the
> negative form will actually suppress anything.  Clang will
> warn for both positive and negative forms of an unknown
> option.
> * m4/warnings.m4 (gl_COMPILER_OPTION_IF): If name begins with
> -Wno-, test if the compiler recognizes the positive form instead.

I've tested this patch with the module that led me to report
this issue (spice-gtk + RHEL6) and the warnings about unsupported -Wno-xxx
flags are now gone.



Attachment: pgpSn0N4cbfcW.pgp
Description: PGP signature

reply via email to

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