From: wolf Date: Thu, 23 Jan 2003 22:03:06 +0000 (+0000) Subject: Check for only partly bracketed mutex initializers, and use -Wno-missing-braces if... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=394534cc5c3c14640583b4f3e46d768f9c3952ef;p=dealii-svn.git Check for only partly bracketed mutex initializers, and use -Wno-missing-braces if necessary. git-svn-id: https://svn.dealii.org/trunk@6947 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index a87ed78cfc..8c2c3d1a7a 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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 + ], + [;], + [ + 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 diff --git a/deal.II/configure.in b/deal.II/configure.in index 2f6b96c37a..fa3a9703c4 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -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