Skip to content

Commit

Permalink
Teuchos: Protect GCC diagnostic pragmas
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Glusa <[email protected]>
  • Loading branch information
cgcgcg committed Feb 26, 2025
1 parent 8ac9b90 commit 102b5bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/teuchos/numerics/src/Teuchos_SerialDenseMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,14 @@ class SerialDenseMatrix : public CompObject, public BLAS<OrdinalType, ScalarType
const OrdinalType numCols)
{
const size_t size = size_t(numRows) * size_t(numCols);
#ifndef _WIN32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvla"
#endif
return new ScalarType[size];
#ifndef _WIN32
#pragma GCC diagnostic pop
#endif
}

OrdinalType numRows_ = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,14 @@ class SerialSymDenseMatrix : public CompObject, public BLAS<OrdinalType,ScalarTy
const OrdinalType numCols)
{
const size_t size = size_t(numRows) * size_t(numCols);
#ifndef _WIN32
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wvla"
#endif
return new ScalarType[size];
#ifndef _WIN32
#pragma GCC diagnostic pop
#endif
}

OrdinalType numRowCols_ = 0;
Expand Down

0 comments on commit 102b5bc

Please sign in to comment.