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

Possibly uninitialized value warnings during compilation #74

Open
lindsayad opened this issue Jun 7, 2021 · 1 comment
Open

Possibly uninitialized value warnings during compilation #74

lindsayad opened this issue Jun 7, 2021 · 1 comment

Comments

@lindsayad
Copy link
Contributor

In file included from /home/lindad/projects/zapdos/crane/build/unity_src/actions_Unity.C:2:
/home/lindad/projects/zapdos/crane/src/actions/AddGeneralReactions.C: In member function ‘virtual void AddGeneralReactions::act()’:
/home/lindad/projects/zapdos/crane/src/actions/AddGeneralReactions.C:365:93: warning: ‘non_electron_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  365 |                 std::find(_species.begin(), _species.end(), _reactants[i][non_electron_index]) !=
      |                                                                                             ^
In file included from /home/lindad/projects/zapdos/crane/build/unity_src/actions_Unity.C:4:
/home/lindad/projects/zapdos/crane/src/actions/AddScalarReactions.C: In member function ‘virtual void AddScalarReactions::act()’:
/home/lindad/projects/zapdos/crane/src/actions/AddScalarReactions.C:424:93: warning: ‘non_electron_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  424 |                 std::find(_species.begin(), _species.end(), _reactants[i][non_electron_index]) !=
      |                                                                                             ^
In file included from /home/lindad/projects/zapdos/crane/build/unity_src/actions_Unity.C:6:
/home/lindad/projects/zapdos/crane/src/actions/AddZapdosReactions.C: In member function ‘virtual void AddZapdosReactions::addEEDFEnergy(const unsigned int&, const string&)’:
/home/lindad/projects/zapdos/crane/src/actions/AddZapdosReactions.C:506:97: warning: ‘non_electron_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  506 |   params.set<std::vector<VariableName>>("target") = {_reactants[reaction_num][non_electron_index]};
      |                                                                                                 ^

I looked in the source for AddGeneralReactions and from the uninformed eye it definitely looks like non_electron_index could be uninitialized

@keniley1
Copy link
Collaborator

keniley1 commented Jun 8, 2021

Your uninformed eye is well informed. Yeah, that can definitely be uninitialized. I'm doing a general cleanup of Crane's actions this week so I'll deal with this soon.

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

No branches or pull requests

2 participants