aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-10-18 16:26:06 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-10-18 16:26:06 +0000
commit747bbdf79ffa7774c1343774e2202cf13105ad6f (patch)
tree92ac8bbe9d76d182f2bf93b833eda6efda27c23e /configure
parent78cfb07fe0dc556cae662a0fab5fe1bd33daabdb (diff)
downloadqemu-747bbdf79ffa7774c1343774e2202cf13105ad6f.zip
qemu-747bbdf79ffa7774c1343774e2202cf13105ad6f.tar.gz
qemu-747bbdf79ffa7774c1343774e2202cf13105ad6f.tar.bz2
Suppress warnings about 'warn_unused_result' attribute directive
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure b/configure
index ca6d45c..7775b1b 100755
--- a/configure
+++ b/configure
@@ -1667,6 +1667,23 @@ if compile_prog "" "" ; then
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
+
+##########################################
# check if we have fdatasync
fdatasync=no
@@ -1994,6 +2011,9 @@ 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