PVS-StudioWarnings

PVS-Studio warning V575 for Doom3

Nov 19th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. void Sys_GetCurrentMemoryStatus( sysMemoryStats_t &stats ) {
  2.   ...
  3.   memset( &statex, sizeof( statex ), 0 );
  4.   ...
  5. }
  6.  
  7. This is what should have been written here: memset( &statex, 0, sizeof( statex ) );
  8.  
  9. This suspicious code was found in Doom3 project by PVS-Studio static code analyzer.
  10. Warning message is:
  11. V575 The 'memset' function processes '0' elements. Inspect the third argument. DoomDLL win_shared.cpp 177
  12.  
  13. 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