Advertisement
PVS-StudioWarnings

PVS-Studio warning V501 for VTK

Nov 27th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. static int
  2. xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
  3.                           xmlSchemaWildcardPtr super)
  4. {
  5.   ...
  6.   if ((sub->negNsSet != NULL) &&
  7.       (super->negNsSet != NULL) &&
  8.       (sub->negNsSet->value == sub->negNsSet->value))
  9.       return (0);
  10.   ...
  11. }
  12.  
  13. This is what should have been written here: (sub->negNsSet->value == super->negNsSet->value).
  14.  
  15. This suspicious code was found in VTK project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V501 There are identical sub-expressions 'sub->negNsSet->value' to the left and to the right of the '==' operator. vtklibxml2 xmlschemas.c 13873
  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