Advertisement
PVS-StudioWarnings

PVS-Studio warning V547 for CamStudio

Nov 24th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #define MAGIC_CONTINUE_NUMBER_LO 0xFE
  2. #define MAGIC_CONTINUE_NUMBER_HI 0x7F
  3.  
  4. /* I can't believe this actually worked */
  5. void bufferResolveJumps(Buffer out)
  6. {
  7.   ....
  8.   if (*p == MAGIC_CONTINUE_NUMBER_LO &&
  9.       *(p+1) == MAGIC_CONTINUE_NUMBER_HI)
  10.   {
  11.   ....
  12. }
  13.  
  14. You're right not to believe. It doesn't work indeed! :-)
  15.  
  16. This suspicious code was found in CamStudio project by PVS-Studio static code analyzer.
  17. Warning message is:
  18. V547 Expression '* p == 0xFE' is always false. The value range of char type: [127, -128]. compile.cpp 527
  19.  
  20. 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