Advertisement
PVS-StudioWarnings

PVS-Studio warning V524 for Clang

Nov 21st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. MapTy PerPtrTopDown;
  2. MapTy PerPtrBottomUp;
  3.  
  4. void clearBottomUpPointers() {
  5.   PerPtrTopDown.clear();
  6. }
  7.  
  8. void clearTopDownPointers() {
  9.   PerPtrTopDown.clear();
  10. }
  11.  
  12. Most likely this is what should be written in clearBottomUpPointers(): PerPtrBottomUp.clear();
  13.  
  14. This suspicious code was found in Clang project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V524 It is odd that the body of 'clearTopDownPointers' function is fully equivalent to the body of 'clearBottomUpPointers' function (ObjCARC.cpp, line 1318). LLVMScalarOpts objcarc.cpp 1322
  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
Advertisement