All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>,
	Blue Swirl <blauwirbel@gmail.com>,
	qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
Date: Sat, 27 Oct 2012 23:32:39 +0200	[thread overview]
Message-ID: <508C52F7.4030302@weilnetz.de> (raw)
In-Reply-To: <1351372747-15992-1-git-send-email-peter.maydell@linaro.org>

Am 27.10.2012 23:19, schrieb Peter Maydell:
> gcc will silently accept unrecognized -Wno-wombat warning suppression
> options (it only mentions them if it has to print a compiler warning
> for some other reason). Since we already run a check for whether gcc
> recognizes the warning options we use, we can easily make this use
> the positive sense of the option when checking for support for the
> suppression option. This doesn't have any effect except that it avoids
> gcc emitting extra messages about unrecognized command line options
> when it is printing other warning messages.
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
>   configure | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 37f712d..4c2ba06 100755
> --- a/configure
> +++ b/configure
> @@ -1169,7 +1169,11 @@ cat>  $TMPC<<  EOF
>   int main(void) { return 0; }
>   EOF
>   for flag in $gcc_flags; do
> -    if compile_prog "-Werror $flag" "" ; then
> +    # Use the positive sense of the flag when testing for -Wno-wombat
> +    # support (gcc will happily accept the -Wno- form of unknown
> +    # warning options).
> +    optflag="$(echo $flag | sed -e 's/^-Wno-/-W/')"
> +    if compile_prog "-Werror $optflag" "" ; then
>   	QEMU_CFLAGS="$QEMU_CFLAGS $flag"
>       fi
>   done

Yes, that's really a very simple and working solution.

Reviewed-by: Stefan Weil <sw@weilnetz.de>

  reply	other threads:[~2012-10-27 21:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-27 21:19 [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat Peter Maydell
2012-10-27 21:32 ` Stefan Weil [this message]
2012-10-28 15:03 ` Igor Mitsyanko
2012-10-30 21:09 ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508C52F7.4030302@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=blauwirbel@gmail.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.