Advertisement
PVS-StudioWarnings

PVS-Studio warning V592 for wxWidgets

Nov 10th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. static void FoldAU3Doc(....)
  2. {
  3.   ...
  4.   // if a keyword is found on the current line
  5.   // and the line doesn't end with _ (continuation)
  6.   // and we are not inside a commentblock.
  7.   if (szKeywordlen > 0 && (!(chPrev == '_')) &&
  8.       ((!(IsStreamCommentStyle(style)) || foldInComment)) ) {
  9.   ...
  10. }
  11.  
  12. This is what should have been written here: if (szKeywordlen > 0 && (!(chPrev == '_')) && (!(IsStreamCommentStyle(style) || foldInComment)) ) {.
  13.  
  14.  
  15. This suspicious code was found in wxWidgets project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present. wxscintilla lexau3.cxx 781
  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