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
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.
I looked in the source for
AddGeneralReactions
and from the uninformed eye it definitely looks likenon_electron_index
could be uninitialized