PVS-StudioWarnings

PVS-Studio warning V567 for AssaultCubeReloaded

Nov 26th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. template<class LINE> struct consolebuffer
  2. {
  3.   void toggleconsole()
  4.   {
  5.     extern int altconsize;
  6.     if(!fullconsole) fullconsole = altconsize ? 1 : 2;
  7.     else fullconsole = ++fullconsole % 3;
  8.   }
  9.   ....
  10. };
  11.  
  12. This suspicious code was found in AssaultCubeReloaded project by PVS-Studio static code analyzer.
  13. Warning message is:
  14. V567 Undefined behavior. The 'fullconsole' variable is modified while being used twice between sequence points. console.h 12
  15.  
  16. 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