PVS-StudioWarnings

PVS-Studio warning V590 for Notepad++

Nov 19th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. int Notepad_plus::getHtmlXmlEncoding(....) const
  2. {
  3.   ...
  4.   if (langT != L_XML && langT != L_HTML && langT == L_PHP)
  5.     return -1;
  6.   ...
  7. }
  8.  
  9. Currently this code is equivalent to if (langT == L_PHP). The programmer probably wanted to write this code: if (langT != L_XML && langT != L_HTML && langT != L_PHP).
  10.  
  11. This suspicious code was found in Notepad++ project by PVS-Studio static code analyzer.
  12. Warning message is:
  13. V590 Consider inspecting this expression. The expression is excessive or contains a misprint.  Notepad++  notepad_plus.cpp  853
  14.  
  15. 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