diff options
author | Eric Blake <eblake@redhat.com> | 2012-09-07 11:42:10 -0600 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-09-07 14:15:22 -0600 |
commit | 892242519acceec2b43d9b534acb468a99330cf4 (patch) | |
tree | 4fe77c7eecda30da3f529487d3457c54c024c69a /m4 | |
parent | 3f685c4dd83d52b6993061e4abaa58b9c7680b6d (diff) | |
download | libvirt-892242519acceec2b43d9b534acb468a99330cf4.tar.gz |
build: fix build on older gcc
On RHEL 6.2, gcc 4.4.6 complains:
cc1: warning: command line option "-Wenum-compare" is valid for C++/ObjC++ but not for C
which in turn breaks a -Werror build.
Meanwhile, in Fedora 17, gcc 4.7.0, -Wenum-compare has been enhanced
to also work on C, but at the same time, it is documented that -Wall
now implicitly includes -Wenum-compare.
Therefore, it is sufficient to remove explicit checks for this option,
avoiding the warning from older gcc while still getting the
compile-time safety from newer gcc.
* m4/virt-compile-warnings.m4 (-Wenum-compare): Omit explicit check.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/virt-compile-warnings.m4 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index c3ff9622e6..d1173eb07d 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -57,6 +57,8 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ dontwarn="$dontwarn -Wformat-nonliteral" # Gnulib's stat-time.h violates this dontwarn="$dontwarn -Waggregate-return" + # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall + dontwarn="$dontwarn -Wenum-compare" # Gnulib uses '#pragma GCC diagnostic push' to silence some # warnings, but older gcc doesn't support this. |