]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Test the annoying std::advance warning.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Sep 2001 08:45:12 +0000 (08:45 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Sep 2001 08:45:12 +0000 (08:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@4984 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure.in

index 0810e8eb30544f3e703c301fca877968afd9fcdb..2ca2ce1e5d9733d4645f72d051d5267bbc085301 100644 (file)
@@ -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 <map>
+#include <vector>
+       ],
+       [
+  std::map<unsigned int, double> m;
+  std::vector<std::pair<unsigned int, double> > v;
+  v.insert (v.end(), m.begin(), m.end());
+       ],
+       [
+         AC_MSG_RESULT(yes)
+       ],
+       [
+         AC_MSG_RESULT(no)
+       ]
+  )
+)
index 7440718b3c7c212471e56012688b609662903bd8..f2f7905f4b870461aaee703f5782dfe2acfac73e 100644 (file)
@@ -258,6 +258,7 @@ if test "$GXX" = yes ; then
        ;;
   esac
 
+  DEAL_II_CHECK_ADVANCE_WARNING
 else
 
   if test "x$GXX_VERSION" = "xibm_xlc" ; then

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.