diff options
author | Aliaksey Kandratsenka <alk@tut.by> | 2015-10-04 11:04:12 -0700 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2015-10-05 21:05:43 -0700 |
commit | 080683089c771cea7be1d5dee82113307d8ef0f7 (patch) | |
tree | 38069eafca1a653688efee7bd3933403fd24d486 | |
parent | 7ce74080347003c3e0c0f0565e91894466e7e146 (diff) | |
download | gperftools-080683089c771cea7be1d5dee82113307d8ef0f7.tar.gz |
correctly test for -Wno-unused-result support
gcc is only giving warning for unknown -Wno-XXX flags so test never
fails on gcc even if -Wno-XXX is not supported. By using
-Wunused-result we're able to test if gcc actually supports it.
This fixes issue #703.
-rw-r--r-- | configure.ac | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 59d275a..e838511 100644 --- a/configure.ac +++ b/configure.ac @@ -306,11 +306,16 @@ AM_CONDITIONAL(I386, test "$is_i386" = yes) AC_CACHE_CHECK([if the compiler supports -Wno-unused-result], perftools_cv_w_no_unused_result, [OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Wno-error -Wno-unused-result" + CFLAGS="$CFLAGS -Wno-error -Wunused-result" # gcc doesn't warn about unknown flags unless it's # also warning for some other purpose, hence the # divide-by-0. (We use -Wno-error to make sure the # divide-by-0 doesn't cause this test to fail!) + # + # Also gcc is giving only warning for unknown flags of + # -Wno-XXX form. So in order to detect support we're + # using -Wunused-result which will cause gcc to give + # error which we can detect. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, return 1/0)], perftools_cv_w_no_unused_result=yes, perftools_cv_w_no_unused_result=no) |