]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check for only partly bracketed mutex initializers, and use -Wno-missing-braces if...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Jan 2003 22:03:06 +0000 (22:03 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Jan 2003 22:03:06 +0000 (22:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@6947 0785d39b-7218-0410-832d-ea1e28bc413d

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

index a87ed78cfcbac9061269292ace715315a59419f7..8c2c3d1a7a086407ea29b032a22fa6a8d312bc81 100644 (file)
@@ -901,6 +901,51 @@ AC_DEFUN(DEAL_II_SET_MULTITHREADING_FLAGS, dnl
 
 
 
+dnl -------------------------------------------------------------
+dnl On some systems, notably AIX and SUN Solaris, using threads
+dnl leads to warnings since the POSIX_MUTEX_INITIALIZER preprocessor
+dnl variable used to initialize POSIX mutex objects does not contain
+dnl initializers for all elements of the mutex. This is not wrong,
+dnl but leads to the message "warning: aggregate has a partly
+dnl bracketed initializer", which is annoying since it shows up
+dnl _very_ often in our files, although this is something that
+dnl happens inside gcc systems headers. So avoid the warning if
+dnl necessary
+dnl
+dnl Usage:
+dnl   DEAL_II_CHECK_CHECK_PARTLY_BRACKETED_INITIALIZER
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_PARTLY_BRACKETED_INITIALIZER, dnl
+[
+  if test "$enablemultithreading" = yes ; then
+    case "$GXX_VERSION" in
+      gcc*)
+       AC_MSG_CHECKING(for only partly bracketed mutex initializer)
+       CXXFLAGS="$CXXFLAGSG -Werror"
+       AC_LANG(C++)
+       AC_TRY_COMPILE(
+       [
+#      include <vector>
+       ],
+        [;],
+        [
+         AC_MSG_RESULT(no)
+        ],
+        [
+         AC_MSG_RESULT(yes)
+         CXXFLAGSG="$CXXFLAGSG -Wno-missing-braces"
+         CXXFLAGSO="$CXXFLAGSO -Wno-missing-braces"
+        ])
+       ;;
+      *)
+        ;;
+    esac
+  fi
+])
+
+
+
 dnl -------------------------------------------------------------
 dnl Test which library the MT code shall use to support threads.
 dnl We used to support either POSIX or ACE, but support for ACE
index 2f6b96c37a7d551fef9680f5edddc90b8358e168..fa3a9703c441b452d09e657e790a4cde04d0e13a 100644 (file)
@@ -138,6 +138,7 @@ dnl does not tell deal.II to actually use it, but the
 dnl compiler flags are set to allow for it.
 DEAL_II_CHECK_MULTITHREADING
 DEAL_II_SET_MULTITHREADING_FLAGS
+DEAL_II_CHECK_PARTLY_BRACKETED_INITIALIZER
 AC_SUBST(enablemultithreading)
 
 dnl Next also check whether the MT code shall be used through POSIX

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.