All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
@ 2012-10-27 21:19 Peter Maydell
  2012-10-27 21:32 ` Stefan Weil
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2012-10-27 21:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Igor Mitsyanko, Blue Swirl, Stefan Weil, patches

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
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
  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
  2012-10-28 15:03 ` Igor Mitsyanko
  2012-10-30 21:09 ` Blue Swirl
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2012-10-27 21:32 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Igor Mitsyanko, Blue Swirl, qemu-devel, patches

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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
  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
@ 2012-10-28 15:03 ` Igor Mitsyanko
  2012-10-30 21:09 ` Blue Swirl
  2 siblings, 0 replies; 4+ messages in thread
From: Igor Mitsyanko @ 2012-10-28 15:03 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Blue Swirl, Stefan Weil, qemu-devel, patches

On 10/28/2012 1:19 AM, Peter Maydell wrote:
> 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
>

Reviewed-by: Igor Mitsyanko <i.mitsyanko@samsung.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: use -Wwombat to test whether gcc recognizes -Wno-wombat
  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
  2012-10-28 15:03 ` Igor Mitsyanko
@ 2012-10-30 21:09 ` Blue Swirl
  2 siblings, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2012-10-30 21:09 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Igor Mitsyanko, Stefan Weil, qemu-devel, patches

Thanks, applied.

On Sat, Oct 27, 2012 at 9:19 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> 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
> --
> 1.7.11.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-30 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-10-28 15:03 ` Igor Mitsyanko
2012-10-30 21:09 ` Blue Swirl

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.