PVS-StudioWarnings

PVS-Studio warning V532 for FCEUX

Nov 18th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. void splitpath(const char* path, char* drv, char* dir,
  2.                char* name, char* ext)
  3. {
  4.   const char* end; /* end of processed string */
  5.   const char* p;  /* search pointer */
  6.   const char* s;  /* copy pointer */
  7.   ...
  8.   for(s=p; s<end; )
  9.     *s++;
  10.   ...
  11. }
  12.  
  13. I cannot understand at all what the programmer wanted to do here. This code is equivalent to s = end.
  14.  
  15. This suspicious code was found in FCEUX project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V532 Consider inspecting  the statement of '*pointer++' pattern. Probably meant: '(*pointer)++'. fceux xstring.cpp 444
  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