PVS-StudioWarnings

PVS-Studio warning V525 for win32-framework

Nov 17th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
  2. {
  3.   ...
  4.   case IDM_FILE_OPEN:
  5.     // Refer to the tutorial for an example of OnFileOpen
  6.     OnFileOpen();
  7.     return TRUE;
  8.   case IDM_FILE_SAVE:
  9.     // Refer to the tutorial for an example of OnFileSave
  10.     OnFileSave();
  11.     return TRUE;
  12.   case IDM_FILE_SAVEAS:
  13.     // Refer to the tutorial for an example of OnFileSaveAs
  14.     OnFileSave();
  15.     return TRUE;
  16.   ...
  17. }
  18.  
  19. Most likely this is what should be written here: case IDM_FILE_SAVEAS: OnFileSaveAs() ....
  20.  
  21. This suspicious code was found in win32-framework project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V525 The code containing the collection of similar blocks. Check items 'OnFileOpen', 'OnFileSave', 'OnFileSave', 'OnFilePrint' in lines 37, 41, 45, 48. Frame mainfrm.cpp 37
  24.  
  25. 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