Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CGNS #391

Closed
wants to merge 1 commit into from
Closed

Fix CGNS #391

wants to merge 1 commit into from

Conversation

jrwrigh
Copy link

@jrwrigh jrwrigh commented Jul 20, 2023

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).

- also something with references that my compiler wasn't happy about
  with regards to the `const auto &m : components` statement
jrwrigh added a commit to jrwrigh/core that referenced this pull request Jul 21, 2023
- also something with references that my compiler wasn't happy about
  with regards to the `const auto &m : components` statement
cwsmith added a commit that referenced this pull request Aug 24, 2024
@cwsmith
Copy link
Contributor

cwsmith commented Aug 24, 2024

@jrwrigh These fixes were added to develop (3e9f07b, 4aa2326, 9f91f21). Thanks for the PR; I would have spent a long time staring at the CGNS_ENUMV. 👍

@cwsmith cwsmith closed this Aug 24, 2024
joshia5 pushed a commit that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants