PVS-StudioWarnings

PVS-Studio warning V521 for TPP

Nov 10th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. bool Peptide::operator==(Peptide& p) {
  2.   ...
  3.   for (i = 0, j = 0;
  4.        i < this->stripped.length(), j < p.stripped.length();
  5.        i++, j++) {
  6.   ...
  7. }
  8.  
  9. The && operator should be used in the loop condition.
  10.  
  11.  
  12. This suspicious code was found in TPP project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V521 Such expressions using the ',' operator are dangerous. Make sure the expression is correct. tpplib peptide.cpp 191
  15.  
  16. PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment