Skip to content

Commit

Permalink
Merge pull request #1186 from Iximiel/fix/plumedcheck-infiniteloop
Browse files Browse the repository at this point in the history
On cpp files with no headers hte check was stuck in the loop
  • Loading branch information
carlocamilloni authored Jan 27, 2025
2 parents d5cc3a1 + 6482925 commit 610ec79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/maketools/plumedcheck
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,10 @@ ENDFILE{
# DOC: macros are exempted from this rule.
error("non_existing_cpp","file " file " is a header but there is no corresponding source");
}
while((getline < cppfile)>=0){
noIncludes=1;
while((getline < cppfile)>0){
if(match($0,"^# *include")){
noIncludes=0;
sub("^# *include","");
# DOC: :non_included_h:
# DOC: The source file corresponding to a header file (that is: with the same name) should include it as the first included file.
Expand All @@ -609,6 +611,7 @@ ENDFILE{
break;
}
}
if(noIncludes==1) error("non_included_h","file " file " is a header but " cppfile " does not include it");
close(cppfile)
}
}
Expand Down

1 comment on commit 610ec79

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/a-masterclass-22-09.txt
Found broken examples in automatic/a-masterclass-22-11.txt
Found broken examples in automatic/a-masterclass-22-12.txt
Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md

Please sign in to comment.