SCOREC / core

parallel finite element unstructured meshes
Other
179 stars 63 forks source link

Fix CGNS #391

Open jrwrigh opened 1 year ago

jrwrigh commented 1 year ago

Removed CGNS_ENUMV usage for variables that didn't require it. Primary reason this worked before is that CGNS_ENUMV can be set such that it doesn't actually do anything, which is normally default. spack automatically enables it to prepend CG_ to everything.

As for the other change, my compiler was giving:

/home/jrwrigh/software/core/mds/mdsCGNS.cc: In member function ‘void {anonymous}::MeshDataGroup::info() const’:
/home/jrwrigh/software/core/mds/mdsCGNS.cc:180:23: error: loop variable ‘m’ creates a copy from type ‘const std::pair<const int, {anonymous}::MeshData>’ [-Werror=range-loop-construct]
  180 |       for (const auto m : components)
      |                       ^
/home/jrwrigh/software/core/mds/mdsCGNS.cc:180:23: note: use reference type to prevent copying
  180 |       for (const auto m : components)
      |                       ^
      |                       &
/home/jrwrigh/software/core/mds/mdsCGNS.cc:186:23: error: loop variable ‘m’ creates a copy from type ‘const std::pair<const int, {anonymous}::MeshData>’ [-Werror=range-loop-construct]
  186 |       for (const auto m : components)
      |                       ^
/home/jrwrigh/software/core/mds/mdsCGNS.cc:186:23: note: use reference type to prevent copying
  186 |       for (const auto m : components)
      |                       ^
      |                       &
/home/jrwrigh/software/core/mds/mdsCGNS.cc:192:23: error: loop variable ‘m’ creates a copy from type ‘const std::pair<const int, {anonymous}::MeshData>’ [-Werror=range-loop-construct]
  192 |       for (const auto m : components)
      |                       ^
/home/jrwrigh/software/core/mds/mdsCGNS.cc:192:23: note: use reference type to prevent copying
  192 |       for (const auto m : components)
      |                       ^
      |                       &
cc1plus: all warnings being treated as errors

So I followed it's suggestion. I'll be honest, I don't know C++ super well, so I have no idea what the problem is (but kind of understand the solution).