From: wolf Date: Wed, 17 Jul 2002 11:20:42 +0000 (+0000) Subject: Work around bug in gcc3.1 on sparc. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6bd15191c6832fd3755729f193414ec84e27404;p=dealii-svn.git Work around bug in gcc3.1 on sparc. git-svn-id: https://svn.dealii.org/trunk@6257 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/polynomial.cc b/deal.II/base/source/polynomial.cc index eca62c2b72..c51c005210 100644 --- a/deal.II/base/source/polynomial.cc +++ b/deal.II/base/source/polynomial.cc @@ -134,11 +134,19 @@ template void Polynomial::shift(typename std::vector& coefficients, const number2 offset) -{ +{ +#ifdef DEAL_II_LONG_DOUBLE_LOOP_BUG + AssertThrow (false, + ExcMessage("Sorry, but the compiler you are using has a bug that disallows " + "compilation of this function, so you cannot use it. Read more " + "about the bug and when it occurs in the aclocal.m4 file in the " + "top level directory (watch for the string " + "DEAL_II_LONG_DOUBLE_LOOP_BUG)")); +#else // Copy coefficients to a vector of // accuracy given by the argument - std::vector new_coefficients(coefficients.size()); - new_coefficients.assign(coefficients.begin(), coefficients.end()); + std::vector new_coefficients(coefficients.begin(), + coefficients.end()); // Traverse all coefficients from // c_1. c_0 will be modified by @@ -181,7 +189,10 @@ Polynomial::shift(typename std::vector& coefficients, // triangle. Assert (binomial_coefficient == 1, ExcInternalError()); } + + // copy new elements to old vector coefficients.assign(new_coefficients.begin(), new_coefficients.end()); +#endif } @@ -466,13 +477,5 @@ template void Polynomial::shift(const float offset); template void Polynomial::shift(const double offset); template void Polynomial::shift(const double offset); template void Polynomial::shift(const long double offset); - -// gcc 3.1 crashes with an internal error when trying to instantiate -// these functions. -// TODO[WB]: check this with an autoconf macro. also fix the #ifdef so that it only works when GCC is actually used! -#if ((__GNUC__ == 3) && (__GNUC_MINOR__ == 1)) -#warning Polynomial::shift with long double has been disabled in gcc 3.1 -#else template void Polynomial::shift(const long double offset); template void Polynomial::shift(const long double offset); -#endif