From 285ec5c366cf590b1fb3f8ba68a3943cb6fd6c5d Mon Sep 17 00:00:00 2001
From: Markus Blatt <mblatt@dune-project.org>
Date: Mon, 21 Jan 2013 11:06:48 +0000
Subject: [PATCH] [clang] prevent warning about variable length arrays not
 being allow.

Fixes FS#1232
Patch provided by Andreas Lauser.


[[Imported from SVN: r1763]]
---
 dune/istl/repartition.hh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dune/istl/repartition.hh b/dune/istl/repartition.hh
index 64159ab8..451e1008 100644
--- a/dune/istl/repartition.hh
+++ b/dune/istl/repartition.hh
@@ -374,7 +374,7 @@ namespace Dune
      * @param domainMapping[] the array of output domain mapping
      */
     template<typename T>
-    void getDomain(const MPI_Comm& comm, T *part, int numOfOwnVtx, int nparts, int *myDomain, int domainMapping[]) {
+    void getDomain(const MPI_Comm& comm, T *part, int numOfOwnVtx, int nparts, int *myDomain, std::vector<int> &domainMapping) {
       int npes, mype;
       MPI_Comm_size(comm, &npes);
       MPI_Comm_rank(comm, &mype);
@@ -384,8 +384,8 @@ namespace Dune
       int i=0;
       int j=0;
 
-      int domain[nparts];
-      int assigned[npes];
+      std::vector<int> domain(nparts);
+      std::vector<int> assigned(npes);
       // init
       for (i=0; i<nparts; i++) {
         domainMapping[i] = -1;
@@ -1394,7 +1394,7 @@ namespace Dune
     //    result
     //
 
-    int domainMapping[nparts];
+    std::vector<int> domainMapping(nparts);
     if(nparts>1)
       getDomain(comm, part, indexMap.numOfOwnVtx(), nparts, &myDomain, domainMapping);
     else
-- 
GitLab