Advertisement
PVS-StudioWarnings

PVS-Studio warning V521 for Quake3

Nov 24th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. void Q1_AllocMaxBSP(void)
  2. {
  3.   ...
  4.   q1_allocatedbspmem +=
  5.     Q1_MAX_MAP_CLIPNODES * sizeof(q1_dclipnode_t);
  6.   ...
  7.   q1_allocatedbspmem +=
  8.     Q1_MAX_MAP_EDGES , sizeof(q1_dedge_t);          <<<---
  9.   ...
  10.   q1_allocatedbspmem +=
  11.     Q1_MAX_MAP_MARKSURFACES * sizeof(unsigned short);
  12.   ...
  13. }
  14.  
  15. This suspicious code was found in Quake3 project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V521 Such expressions using the ',' operator are dangerous. Make sure the expression is correct. bspc l_bsp_q1.c 136
  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