From 084146ce64cf5587ef008d7d11f4e1959c2c98d3 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 13 Sep 2001 08:45:12 +0000 Subject: [PATCH] Test the annoying std::advance warning. git-svn-id: https://svn.dealii.org/trunk@4984 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 32 ++++++++++++++++++++++++++++++++ deal.II/configure.in | 1 + 2 files changed, 33 insertions(+) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 0810e8eb30..2ca2ce1e5d 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -475,3 +475,35 @@ AC_DEFUN(DEAL_II_CHECK_ACE_FORBIDDEN_FLAGS, dnl fi fi ) + + + +dnl gcc versions up to 2.95.3 had a problem with the std::advance function, +dnl when the number of steps forward was given by an unsigned number, since +dnl a comparison >=0 was performed on this number which leads to a warning +dnl that this comparison is always true. This is, at the best, annoying +dnl since it crops up at several places where std::advance is called from +dnl inside the library. Check whether the present version of the compiler +dnl has this problem +AC_DEFUN(DEAL_II_CHECK_ADVANCE_WARNING, dnl + AC_LANG_CPLUSPLUS + CXXFLAGS="$CXXFLAGSG -Werror" + AC_MSG_CHECKING(for std::advance warning) + AC_TRY_COMPILE( + [ +#include +#include + ], + [ + std::map m; + std::vector > v; + v.insert (v.end(), m.begin(), m.end()); + ], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + ] + ) +) diff --git a/deal.II/configure.in b/deal.II/configure.in index 7440718b3c..f2f7905f4b 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -258,6 +258,7 @@ if test "$GXX" = yes ; then ;; esac + DEAL_II_CHECK_ADVANCE_WARNING else if test "x$GXX_VERSION" = "xibm_xlc" ; then -- 2.39.5