PVS-StudioWarnings

PVS-Studio warning V526 for wxWidgets

Nov 19th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. static void ColouriseErlangDoc(....) {
  2. {
  3.   ...
  4.   } else if (erlangBIFs.InList(cur)
  5.              && strcmp(cur,"erlang:")){
  6.     style = SCE_ERLANG_BIFS;
  7.   }
  8.   ...
  9. }
  10.  
  11. Everywhere in the other files a construct of the strcmp() == 0 or strcmp() != 0 kind is used.
  12. Most likely this is what should be written here: strcmp(cur,"erlang:") == 0
  13.  
  14. This suspicious code was found in wxWidgets project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V526 The 'strcmp' function returns 0 if corresponding strings are equal. Consider examining the condition for mistakes. wxscintilla lexerlang.cxx 204
  17.  
  18. 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