From 825b43d049bb5fa161cb6a59153d8348713a6c83 Mon Sep 17 00:00:00 2001 From: "Mulas, Giacomo" <gmulas@oa-cagliari.inaf.it> Date: Mon, 18 Mar 2024 20:33:15 +0100 Subject: [PATCH] work around stupid g++11 implementation to allocate am_2[0] --- src/cluster/cluster.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index c7a43b35..3344e262 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -501,9 +501,9 @@ void cluster(string config_file, string data_file, string output_path) { double vk_2 = vk; np_int ndit_2 = ndit; dcomplex **am_2 = new dcomplex*[ndit]; - dcomplex am_2[0] = new dcomplex[ndit * ndit](); - for (int ai = 1; ai < ndit; ai++) { - am_2[ai] = (am_2[0] + ai * ndit); + dcomplex *am_vector_2 = new dcomplex[ndit * ndit](); + for (int ai = 0; ai < ndit; ai++) { + am_2[ai] = (am_vector_2 + ai * ndit); } int isq_2 = isq; int ibf_2 = ibf; @@ -586,7 +586,7 @@ void cluster(string config_file, string data_file, string output_path) { delete[] unsmp_2; delete[] upmp_2; delete[] upsmp_2; - delete[] am_2[0]; + delete[] am_vector_2; delete[] am_2; } // jxi488 loop -- GitLab