diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index e05491308c9b3254d2cfe01112e412bd2bfd3af1..fbeb3eb5e1c3d14555b6792f62e8215b216952fb 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -94,6 +94,9 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ dontwarn="$dontwarn -Wmissing-prototypes" dontwarn="$dontwarn -Wmissing-declarations" dontwarn="$dontwarn -Wcast-align" + else + AC_DEFINE_UNQUOTED([WORKING_PRAGMA_PUSH], 1, + [Define to 1 if gcc supports pragma push/pop]) fi dnl Check whether strchr(s, char variable) causes a bogus compile diff --git a/src/internal.h b/src/internal.h index d819aa39a2b8aecc8419f37b6052f63b7c4ead2a..03c2493c7d2171d2b50b11a2e782cdcfd596f0eb 100644 --- a/src/internal.h +++ b/src/internal.h @@ -215,7 +215,7 @@ # endif /* __GNUC__ */ -# if __GNUC_PREREQ (4, 6) +# if WORKING_PRAGMA_PUSH # define VIR_WARNINGS_NO_CAST_ALIGN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wcast-align\"")