[MOAB-dev] r4279 - in MOAB/trunk: . config src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Thu Nov 18 14:15:25 CST 2010


Author: kraftche
Date: 2010-11-18 14:15:25 -0600 (Thu, 18 Nov 2010)
New Revision: 4279

Modified:
   MOAB/trunk/config/cplusplus.m4
   MOAB/trunk/configure.ac
   MOAB/trunk/src/Skinner.cpp
Log:
Specify -pedantic if compiler is G++ because people keep declaring variable-length C arrays and that's the only way to prevent it with G++.  If this flag breaks builds for older versions of G++, let me know and I'll add appropraite configure logic.  Also, more portability fixes

Modified: MOAB/trunk/config/cplusplus.m4
===================================================================
--- MOAB/trunk/config/cplusplus.m4	2010-11-18 19:41:39 UTC (rev 4278)
+++ MOAB/trunk/config/cplusplus.m4	2010-11-18 20:15:25 UTC (rev 4279)
@@ -201,3 +201,26 @@
   NO_VECTOR_TEMPLATE_INSERT=-DNO_VECTOR_TEMPLATE_INSERT
 fi
 ])
+
+#######################################################################################
+# Check if c++ standard library implements old-style std::count
+# The standard specifies that count return the result.
+# The original SGI version accepted an integer reference as its 
+# last argument and incremented that for each match.
+# Sets OLD_STD_COUNT=-DOLD_STD_COUNT
+# if old format is required.
+#######################################################################################
+AC_DEFUN([FATHOM_OLD_STD_COUNT],[
+AC_CACHE_CHECK([if std::copy must be old SGI format],
+               [fathom_cv_std_count_old_sgi],[
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM( [#include <algorithm>], [int* a, b = std::count(a, a, 5);])],
+ [fathom_cv_std_count_old_sgi=no],
+ [fathom_cv_std_count_old_sgi=yes])
+AC_LANG_POP([C++])])
+OLD_STD_COUNT=
+if test $fathom_cv_std_count_old_sgi = yes; then
+  OLD_STD_COUNT=-DOLD_STD_COUNT
+fi
+])

Modified: MOAB/trunk/configure.ac
===================================================================
--- MOAB/trunk/configure.ac	2010-11-18 19:41:39 UTC (rev 4278)
+++ MOAB/trunk/configure.ac	2010-11-18 20:15:25 UTC (rev 4279)
@@ -21,7 +21,7 @@
   [No Fortran name mangling in ITAPS/MBCN C headers])],
   [ENABLE_FORTRAN=$enableval],[ENABLE_FORTRAN=yes])
 
-EXTRA_GNU_FLAGS='-Wall -pipe'
+EXTRA_GNU_FLAGS='-Wall -pipe -pedantic'
 FATHOM_CHECK_COMPILERS([yes],[yes],[$ENABLE_FORTRAN])
 AM_CONDITIONAL(PARALLEL,[test "x$WITH_MPI" != "xno"])
 LIBS="-lm"
@@ -60,7 +60,8 @@
 AM_CPPFLAGS="$AM_CPPFLAGS -D_FILE_OFFSET_BITS=64"
 
 FATHOM_VECTOR_TEMPLATE_INSERT
-AM_CPPFLAGS="$AM_CPPFLAGS $NO_VECTOR_TEMPLATE_INSERT"
+FATHOM_OLD_STD_COUNT


More information about the moab-dev mailing list