[Qemu-devel] [PATCH] build: add -Wexpansion-to-defined

Paolo Bonzini posted 1 patch 8 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170711081033.12399-1-pbonzini@redhat.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] build: add -Wexpansion-to-defined
Posted by Paolo Bonzini 8 years, 3 months ago
This warning is included in -Wall by clang, but not by GCC (which only
enables it for -Wextra).  Include it in the list of warnings we enable
to minimize the differences between the compilers:

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 806658c98b..bd1769d4d8 100755
--- a/configure
+++ b/configure
@@ -1583,7 +1583,7 @@ gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
 gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
 gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
 gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
-gcc_flags="-Wno-initializer-overrides $gcc_flags"
+gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
 gcc_flags="-Wno-string-plus-int $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
-- 
2.13.0


Re: [Qemu-devel] [PATCH] build: add -Wexpansion-to-defined
Posted by Stefan Hajnoczi 8 years, 3 months ago
On Tue, Jul 11, 2017 at 10:10:33AM +0200, Paolo Bonzini wrote:
> This warning is included in -Wall by clang, but not by GCC (which only
> enables it for -Wextra).  Include it in the list of warnings we enable
> to minimize the differences between the compilers:
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

For anyone interested in what this warning does:
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html#index-Wexpansion-to-defined

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>