From: Matthias Maier Date: Tue, 20 Apr 2021 01:23:51 +0000 (-0500) Subject: fix a warning X-Git-Tag: v9.3.0-rc1~207^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=396fe0dd28bd560dbff391bf0212c960df47f0fc;p=dealii.git fix a warning This fixes a warning emitted by gcc-10.3.0: warning: comparison of unsigned expression in ‘< 0’ is always false [-Wtype-limits] --- diff --git a/source/base/quadrature_lib.cc b/source/base/quadrature_lib.cc index 0f69c4e9c9..b72c6564f0 100644 --- a/source/base/quadrature_lib.cc +++ b/source/base/quadrature_lib.cc @@ -1203,7 +1203,11 @@ QSimplex::QSimplex(const Quadrature &quad) for (unsigned int i = 0; i < quad.size(); ++i) { double r = 0; - for (unsigned int d = 0; d < dim; ++d) + /* Use "int d" instead of the more natural "unsigned int d" to work + * around a wrong diagnostic in gcc-10.3.0 that warns about that the + * comparison "d < dim" is always false in case of "dim == 0". + * MM 2021 */ + for (int d = 0; d < dim; ++d) r += quad.point(i)[d]; if (r <= 1 + 1e-10) {