From: wolf Date: Fri, 6 Oct 2000 14:28:26 +0000 (+0000) Subject: Avoid warning about possibly unitialized variable. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a32301dcd92bb1e40d09b208c820d5224acccf5e;p=dealii-svn.git Avoid warning about possibly unitialized variable. git-svn-id: https://svn.dealii.org/trunk@3397 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-7/step-7.cc b/deal.II/examples/step-7/step-7.cc index e2e35aec01..819a6f7ec3 100644 --- a/deal.II/examples/step-7/step-7.cc +++ b/deal.II/examples/step-7/step-7.cc @@ -1528,11 +1528,21 @@ void LaplaceProblem::run () // output. For example, if you give // ``2'', this leads to 4 cells in // 2D and 8 cells in 3D. For - // quadratic elements, two sub-cells - // per space direction is obviously - // the right choice, so this is - // what we choose: - unsigned int n_subcells; + // quadratic elements, two + // sub-cells per space direction is + // obviously the right choice, so + // this is what we choose (note + // that the variable is initialized + // anyway to avoid an error message + // about possible use without + // initialization in optimized + // mode, where the compiler does + // not abort the program in the + // second `else' clause; however, + // the value in the initialization + // is such that it should be + // invalid): + unsigned int n_subcells = static_cast(-1); if (typeid(*fe) == typeid(const FEQ1)) n_subcells = 1; else