]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Address warnings about unused variables 14572/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 12 Dec 2022 22:33:38 +0000 (17:33 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 12 Dec 2022 22:33:38 +0000 (17:33 -0500)
source/base/polynomials_rt_bubbles.cc

index edc10df6b93a03233f9397e3c912a50cc9f17782..8b7aadeb839653d2e667fd16701fb43826fd07af 100644 (file)
@@ -107,11 +107,18 @@ PolynomialsRT_Bubbles<dim>::evaluate(
   // of the curl part of the space
   const unsigned int n_derivatives = 3;
   double             monoval_plus[dim][n_derivatives + 1];
-  double             monoval[dim][n_derivatives + 1];
+  double             monoval_i[dim][n_derivatives + 1];
 
-  double monoval_i[dim][n_derivatives + 1];
-  double monoval_j[dim][n_derivatives + 1];
-  double monoval_jplus[dim][n_derivatives + 1];
+
+#ifdef DEAL_II_HAVE_CXX17
+  if constexpr (dim <= 1)
+#else
+  if (dim <= 1)
+#endif
+    {
+      (void)monoval_plus;
+      (void)monoval_i;
+    }
 
   unsigned int start = n_sub;
 #ifdef DEAL_II_HAVE_CXX17
@@ -207,6 +214,10 @@ PolynomialsRT_Bubbles<dim>::evaluate(
   else if (dim == 3)
 #endif
     {
+      double monoval[dim][n_derivatives + 1];
+      double monoval_j[dim][n_derivatives + 1];
+      double monoval_jplus[dim][n_derivatives + 1];
+
       // In 3d the first type of basis vector is
       //  [ x^i * y^j * z^k * (j+k+2) ]
       //  [  -[x^i]' * y^(j+1) * z^k  ]

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.