Fix GCC-11 warning
authorAndrey Alekseenko <al42and@gmail.com>
Tue, 4 May 2021 09:21:27 +0000 (11:21 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 4 May 2021 14:38:17 +0000 (14:38 +0000)
It complained about pbcatom_input being uninitialized.
Does not seem like it is used anywhere before being set in
process_pull_groups, but better initialize it just in case.

src/gromacs/gmxpreprocess/readpull.cpp

index c5194634ef138e053438857aeba1a52be3c91050..9259884432c0859fe8f2fbebf92317bacb5769d7 100644 (file)
@@ -351,14 +351,15 @@ std::vector<std::string> read_pullparams(std::vector<t_inpfile>* inp, pull_param
     pull->group.emplace_back(t_pull_group());
     for (int groupNum = 1; groupNum < pull->ngroup; groupNum++)
     {
-        t_pull_group pullGroup; //= &pull->group[groupNum];
+        t_pull_group pullGroup;
         sprintf(buf, "pull-group%d-name", groupNum);
         setStringEntry(inp, buf, readBuffer, "");
         pullGroups[groupNum] = readBuffer;
         sprintf(buf, "pull-group%d-weights", groupNum);
         setStringEntry(inp, buf, wbuf, "");
         sprintf(buf, "pull-group%d-pbcatom", groupNum);
-        pullGroup.pbcatom = get_eint(inp, buf, 0, wi);
+        pullGroup.pbcatom       = get_eint(inp, buf, 0, wi);
+        pullGroup.pbcatom_input = pullGroup.pbcatom;
 
         /* Initialize the pull group */
         pullGroup.weight = setupPullGroupWeights(wbuf);