]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some GCC-12 warnings.
authorDavid Wells <drwells@email.unc.edu>
Sat, 14 May 2022 18:12:09 +0000 (14:12 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sat, 14 May 2022 18:12:09 +0000 (14:12 -0400)
include/deal.II/base/config.h.in
source/fe/fe_rt_bubbles.cc

index aff1915bcbaeddf3c97b0747bff05731a4b5d1cf..4ab74a0df452f1c39158834df6f9e3223aac3076 100644 (file)
@@ -463,6 +463,7 @@ _Pragma("GCC diagnostic ignored \"-Wunused-function\"")                 \
 _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")                \
 _Pragma("GCC diagnostic ignored \"-Wunused-private-field\"")            \
 _Pragma("GCC diagnostic ignored \"-Wunused-variable\"")                 \
+_Pragma("GCC diagnostic ignored \"-Wuse-after-free\"")                  \
 _Pragma("GCC diagnostic warning \"-Wpragmas\"")                   /*!*/
 
 #  define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS                              \
index bd3b3ce960038cb7c00cc3dbd0ed6ab690ad275e..14d9a36be84f19f4093eb06ac3225c672ebe3597 100644 (file)
@@ -208,8 +208,11 @@ FE_RT_Bubbles<dim>::initialize_support_points(const unsigned int deg)
   // one for each direction
   QGaussLobatto<1>      high(deg + 1);
   std::vector<Point<1>> pts = high.get_points();
-  pts.erase(pts.begin());
-  pts.erase(pts.end() - 1);
+  if (pts.size() > 2)
+    {
+      pts.erase(pts.begin());
+      pts.erase(pts.end() - 1);
+    }
 
   std::vector<double> wts(pts.size(), 1);
   Quadrature<1>       low(pts, wts);

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.