From 4e8fa1ede4e05acc29293d4f45db7aaeef58618b Mon Sep 17 00:00:00 2001 From: Knut Morten Okstad Date: Tue, 13 Dec 2016 16:32:55 +0100 Subject: [PATCH] Fixed: Avoid zero-length array that is written to (caused crash on clang) --- src/SIM/SIMbase.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SIM/SIMbase.C b/src/SIM/SIMbase.C index b7171aad..50afa3f1 100644 --- a/src/SIM/SIMbase.C +++ b/src/SIM/SIMbase.C @@ -1893,8 +1893,8 @@ void SIMbase::printSolutionSummary (const Vector& solution, int printSol, { // Compute and print solution norms const size_t nf = this->getNoFields(1); - size_t iMax[nf]; - double dMax[nf]; + size_t iMax[nf > 0 ? nf : nsd]; + double dMax[nf > 0 ? nf : nsd]; double dNorm = this->solutionNorms(solution,dMax,iMax,nf); int oldPrec = adm.cout.precision();