From: Matthias Maier Date: Thu, 18 Jan 2024 22:52:40 +0000 (-0600) Subject: TpetraWrappers: fix dangling else warning, fix embedded macro warning X-Git-Tag: relicensing~139^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35830de6992dda0d443506c0ddbdf4455cf93b47;p=dealii.git TpetraWrappers: fix dangling else warning, fix embedded macro warning Triggered on gcc-9.4.0 on Ubuntu LTS 20.04 --- diff --git a/include/deal.II/lac/trilinos_tpetra_vector.h b/include/deal.II/lac/trilinos_tpetra_vector.h index a34e7d87ba..1411617a8f 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.h @@ -1001,10 +1001,12 @@ namespace LinearAlgebra # endif if (local_row != Teuchos::OrdinalTraits::invalid()) - if (nonlocal) - vector_1d_nonlocal(local_row) += values[i]; - else - vector_1d_local(local_row) += values[i]; + { + if (nonlocal) + vector_1d_nonlocal(local_row) += values[i]; + else + vector_1d_local(local_row) += values[i]; + } } # if !DEAL_II_TRILINOS_VERSION_GTE(13, 2, 0) diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index e119b4f5ad..6d93e62eeb 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -247,14 +247,16 @@ namespace LinearAlgebra vector->getMap()->getLocalElement(row); +# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0) Assert( local_row != Teuchos::OrdinalTraits::invalid(), -# if DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0) ExcAccessToNonLocalElement(row, vector->getMap()->getLocalNumElements(), vector->getMap()->getMinLocalIndex(), vector->getMap()->getMaxLocalIndex())); # else + Assert( + local_row != Teuchos::OrdinalTraits::invalid(), ExcAccessToNonLocalElement(row, vector->getMap()->getNodeNumElements(), vector->getMap()->getMinLocalIndex(),