summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler.h2
-rwxr-xr-xconfigure20
2 files changed, 1 insertions, 21 deletions
diff --git a/compiler.h b/compiler.h
index 3a9b8a1..a1c0794 100644
--- a/compiler.h
+++ b/compiler.h
@@ -18,7 +18,7 @@
#define QEMU_NORETURN __attribute__ ((__noreturn__))
-#ifdef CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT
+#if QEMU_GNUC_PREREQ(3, 4)
#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
#define QEMU_WARN_UNUSED_RESULT
diff --git a/configure b/configure
index 8507846..24b8df4 100755
--- a/configure
+++ b/configure
@@ -2359,23 +2359,6 @@ if compile_prog "" "" ; then
need_offsetof=no
fi
-##########################################
-# check if the compiler understands attribute warn_unused_result
-#
-# This could be smarter, but gcc -Werror does not error out even when warning
-# about attribute warn_unused_result
-
-gcc_attribute_warn_unused_result=no
-cat > $TMPC << EOF
-#if defined(__GNUC__) && (__GNUC__ < 4) && defined(__GNUC_MINOR__) && (__GNUC__ < 4)
-#error gcc 3.3 or older
-#endif
-int main(void) { return 0;}
-EOF
-if compile_prog "" ""; then
- gcc_attribute_warn_unused_result=yes
-fi
-
# spice probe
if test "$spice" != "no" ; then
cat > $TMPC << EOF
@@ -2998,9 +2981,6 @@ fi
if test "$need_offsetof" = "yes" ; then
echo "CONFIG_NEED_OFFSETOF=y" >> $config_host_mak
fi
-if test "$gcc_attribute_warn_unused_result" = "yes" ; then
- echo "CONFIG_GCC_ATTRIBUTE_WARN_UNUSED_RESULT=y" >> $config_host_mak
-fi
if test "$fdatasync" = "yes" ; then
echo "CONFIG_FDATASYNC=y" >> $config_host_mak
fi
OpenPOWER on IntegriCloud