Advertisement
PVS-StudioWarnings

PVS-Studio warning V612 for TPP

Nov 20th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. const char* ResidueMass::getStdModResidues(....) {
  2.   ...
  3.   for (rmap::const_iterator i = p.first; i != p.second; ++i) {
  4.     const cResidue &r = (*i).second;
  5.     if (r.m_masses[0].m_nterm) {
  6.       n_term_aa_mod = true;
  7.     } else if (r.m_masses[0].m_cterm) {
  8.       c_term_aa_mod = true;
  9.     }
  10.     return r.m_residue.c_str();            <<<---
  11.   }
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in TPP project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V612 An unconditional 'return' within a loop. tpplib residuemass.cxx 1442
  18.  
  19. 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
Advertisement