PVS-StudioWarnings

PVS-Studio warning V617 for Word11a

Nov 18th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. ....
  2. #define wkHdr    0x4000
  3. #define wkFtn    0x2000
  4. #define wkAtn    0x0008
  5. ....
  6. #define wkSDoc    (wkAtn+wkFtn+wkHdr)
  7.  
  8. CMD CmdGoto (pcmb)
  9. CMB * pcmb;
  10. {
  11.   ....
  12.   int wk = PwwdWw(wwCur)->wk;
  13.     if (wk | wkSDoc)
  14.       NewCurWw((*hmwdCur)->wwUpper, fTrue);
  15.   ....
  16. }
  17.  
  18. Most likely this is what should be written here: if (wk & wkSDoc)
  19.  
  20. This suspicious code was found in Word11a project by PVS-Studio static code analyzer.
  21. Warning message is:
  22. V617 Consider inspecting the condition. The '(0x0008 + 0x2000 + 0x4000)' argument of the '|' bitwise operation contains a non-zero value. dlgmisc.c 409
  23.  
  24. 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